From ba9e8948298a5abae1ef4a02d931887ed4f6bbc4 Mon Sep 17 00:00:00 2001 From: asonix Date: Fri, 10 Feb 2023 17:03:57 -0600 Subject: [PATCH] Deploy redtail1 and whitestorm2 --- flake.nix | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index c724aad..735775f 100644 --- a/flake.nix +++ b/flake.nix @@ -332,7 +332,7 @@ ]; }; - makePostgresConfig = { hostname, keyFile, primaryIp ? null }: + makePostgresConfig = { hostname, selfIp, macAddress, keyFile, primaryIp ? null }: with image-builder.packages.aarch64-linux.modules; let device = "/dev/mapper/cryptdrive1"; @@ -380,6 +380,21 @@ options = [ "defaults" "compress=zstd" "rw" ]; }; }) + { + networking = { + interfaces.end0 = { + inherit macAddress; + ipv4.addresses = [ + { + address = selfIp; + prefixLength = 24; + } + ]; + }; + defaultGateway = "192.168.20.1"; + nameservers = [ "192.168.20.21" "192.168.20.1" ]; + }; + } ]; }; @@ -412,24 +427,32 @@ redtail1 = makePostgresConfig { hostname = "redtail1"; + selfIp = "192.168.20.23"; + macAddress = "02:fe:30:d8:cf:64"; keyFile = "redtailKeyFile"; primaryIp = "192.168.20.24"; }; redtail2 = makePostgresConfig { hostname = "redtail2"; + selfIp = "192.168.20.24"; + macAddress = "02:8a:70:2a:a8:5e"; keyFile = "redtailKeyFile"; # primaryIp = "192.168.20.23"; }; whitestorm1 = makePostgresConfig { hostname = "whitestorm1"; + selfIp = "192.168.20.26"; + macAddress = "02:71:18:30:fc:0f"; keyFile = "whitestormKeyFile"; - # primaryIp = "192.168.20.11"; + # primaryIp = "192.168.20.27"; }; whitestorm2 = makePostgresConfig { hostname = "whitestorm2"; + selfIp = "192.168.20.27"; + macAddress = "02:ff:ce:a9:d3:74"; keyFile = "whitestormKeyFile"; primaryIp = "192.168.20.26"; }; @@ -517,6 +540,16 @@ }; }; + deploy.nodes.redtail1 = deployer { + hostname = "192.168.20.23"; + configuration = self.nixosConfigurations.redtail1; + }; + + deploy.nodes.whitestorm2 = deployer { + hostname = "192.168.20.27"; + configuration = self.nixosConfigurations.whitestorm2; + }; + deploy.nodes.nextcloud2 = deployer { hostname = "192.168.20.28"; configuration = self.nixosConfigurations.nextcloud2;