Move deployment-related options to separate attrset

Since we factored out deployment-independent options to separate flake
the options that are left in this flake are still using the same
namespace. This change renames the option attrset local to this flake.
This commit is contained in:
oxapentane - 2022-09-23 20:38:14 +02:00
parent 0707d30af0
commit a3a5d0652c
Signed by: oxapentane
GPG Key ID: 91FA5E5BF9AA901C
19 changed files with 23 additions and 25 deletions

View File

@ -69,7 +69,7 @@
specialArgs = inputs;
modules = [
{
dump-dvb.systemNumber = id;
ddvbDeployment.systemNumber = id;
}
] ++ extraModules ++ stop-box-modules;
};

View File

@ -21,8 +21,8 @@
allowedIPs = [ "10.13.37.3/32" ];
persistentKeepalive = 25;
}
# data hoarder staging
{
# data hoarder staging
publicKey = "48hc7DVnUh2DHYhrxrNtNzj05MRecJO52j2niPImvkU=";
allowedIPs = [ "10.13.37.5/32" ];
persistentKeepalive = 25;
@ -85,5 +85,3 @@
};
};
}

View File

@ -67,7 +67,7 @@
# Or disable the firewall altogether.
networking.firewall.enable = true;
dump-dvb.domain = "staging.dvb.solutions";
ddvbDeployment.domain = "staging.dvb.solutions";
networking.wg-quick.interfaces.wg-dvb = {
address = [ "10.13.37.5/32" ];
privateKeyFile = config.sops.secrets.wg-seckey.path;

View File

@ -3,7 +3,7 @@
{
boot.tmpOnTmpfs = true;
networking.hostName = "traffic-stop-box-${toString config.dump-dvb.systemNumber}"; # Define your hostname.
networking.hostName = "traffic-stop-box-${toString config.ddvbDeployment.systemNumber}"; # Define your hostname.
# Set your time zone.
time.timeZone = "Europe/Berlin";

View File

@ -1,7 +1,7 @@
{ config, lib, ... }:
let
file = ../../configs/config_${toString config.dump-dvb.systemNumber}.json;
file = ../../configs/config_${toString config.ddvbDeployment.systemNumber}.json;
receiver_configs = [
{ frequency = 170795000; offset = 19550; device = "hackrf=0"; RF = 14; IF = 8; BB = 42; } # dresden - barkhausen
{ frequency = 170795000; offset = 19400; device = "hackrf=0"; RF = 14; IF = 8; BB = 42; } # dresden - zentralwerk
@ -13,7 +13,7 @@ let
{ frequency = 150827500; offset = 19550; device = ""; RF = 14; IF = 32; BB = 42; } # drehturm aachen
];
receiver_config = lib.elemAt receiver_configs config.dump-dvb.systemNumber;
receiver_config = lib.elemAt receiver_configs config.ddvbDeployment.systemNumber;
in
{
dump-dvb.gnuradio = {

View File

@ -1,6 +1,6 @@
{ config, ... }:
{
sops.defaultSopsFile = ../../secrets/traffic-stop-box-${toString config.dump-dvb.systemNumber}/secrets.yaml;
sops.defaultSopsFile = ../../secrets/traffic-stop-box-${toString config.ddvbDeployment.systemNumber}/secrets.yaml;
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
sops.secrets.wg-seckey = { };

View File

@ -4,7 +4,7 @@
networking.firewall.allowedUDPPorts = [ 51820 ];
networking.wg-quick.interfaces.wg-dvb = {
address = [ "10.13.37.${toString (config.dump-dvb.systemNumber + 100)}/32" ];
address = [ "10.13.37.${toString (config.ddvbDeployment.systemNumber + 100)}/32" ];
privateKeyFile = config.sops.secrets.wg-seckey.path;
postUp = ''
${pkgs.iputils}/bin/ping -c 10 10.13.37.1 || true

View File

@ -1,7 +1,7 @@
{ pkgs, config, ... }: {
services.nginx = {
enable = true;
virtualHosts."click.${config.dump-dvb.domain}" = {
virtualHosts."click.${config.ddvbDeployment.domain}" = {
enableACME = true;
forceSSL = true;
locations."/" = {

View File

@ -21,7 +21,7 @@
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"management-backend.${config.dump-dvb.domain}" = {
"management-backend.${config.ddvbDeployment.domain}" = {
forceSSL = true;
enableACME = true;
locations = {

View File

@ -32,7 +32,7 @@
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"dump.${config.dump-dvb.domain}" = {
"dump.${config.ddvbDeployment.domain}" = {
forceSSL = true;
enableACME = true;
locations = {

View File

@ -8,7 +8,7 @@ in
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"docs.${config.dump-dvb.domain}" = {
"docs.${config.ddvbDeployment.domain}" = {
enableACME = true;
forceSSL = true;
locations = {

View File

@ -20,7 +20,7 @@ in
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"api.${config.dump-dvb.domain}" = {
"api.${config.ddvbDeployment.domain}" = {
forceSSL = true;
enableACME = true;
locations = {

View File

@ -4,7 +4,7 @@
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"files.${config.dump-dvb.domain}" = {
"files.${config.ddvbDeployment.domain}" = {
enableACME = true;
forceSSL = true;
root = "/var/lib/pub-files/";

View File

@ -54,7 +54,7 @@
params = { module = [ "http_2xx" ]; };
static_configs = [{
targets = [
"api.${config.dump-dvb.domain}"
"api.${config.ddvbDeployment.domain}"
];
}];
relabel_configs = [
@ -82,7 +82,7 @@
# visualizer
grafana = {
enable = true;
domain = "monitoring.${config.dump-dvb.domain}";
domain = "monitoring.${config.ddvbDeployment.domain}";
port = 2342;
addr = "127.0.0.1";

View File

@ -4,7 +4,7 @@
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"map.${config.dump-dvb.domain}" = {
"map.${config.ddvbDeployment.domain}" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
@ -13,7 +13,7 @@
locations = {
"/" = {
root = if (config.dump-dvb.domain == "dvb.solutions") then "${pkgs.windshield}/bin/" else "${pkgs.windshield-staging}/bin/";
root = if (config.ddvbDeployment.domain == "dvb.solutions") then "${pkgs.windshield}/bin/" else "${pkgs.windshield-staging}/bin/";
index = "index.html";
};
"~ \.(json)" = {

View File

@ -19,7 +19,7 @@ in
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"socket.${config.dump-dvb.domain}" = {
"socket.${config.ddvbDeployment.domain}" = {
forceSSL = true;
enableACME = true;
locations = {

View File

@ -2,7 +2,7 @@
services.nginx = {
enable = true;
virtualHosts = {
"${config.dump-dvb.domain}" = {
"${config.ddvbDeployment.domain}" = {
enableACME = true;
forceSSL = true;
locations = {

View File

@ -1,13 +1,13 @@
{ lib, ... }:
with lib; {
options = {
dump-dvb.systemNumber = mkOption {
ddvbDeployment.systemNumber = mkOption {
type = types.int;
default = 0;
description = "number of the system";
};
dump-dvb.domain = mkOption {
ddvbDeployment.domain = mkOption {
type = types.str;
default = "dvb.solutions";
description = "domain the server is running on";

View File

@ -2,7 +2,7 @@
let
installScript = (system:
let ip = "10.13.37.${toString (system.config.dump-dvb.systemNumber + 100)}";
let ip = "10.13.37.${toString (system.config.ddvbDeployment.systemNumber + 100)}";
in
(pkgs.writeScriptBin "deploy" ''
#!${pkgs.runtimeShell}