ctucx.git: nixfiles

ctucx' nixfiles

commit a0b682234464f47851070b107ea7fb4149c9f20d
parent 03c0180f4763d4927d9eaea34353e434dc518206
Author: Leah (ctucx) <git@ctu.cx>
Date: Mon, 27 Mar 2023 14:40:52 +0200

modules/linux/restic-backups: add wanderduene as target
3 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/machines/lollo/configuration.nix b/machines/lollo/configuration.nix
@@ -7,7 +7,6 @@
 
     ./hardware-configuration.nix
 
-
     ./scanner-sftp.nix
 
     #dns server

@@ -35,8 +34,9 @@
   dns.zones."ctu.cx".subdomains."legacy.home"                        = lib.mkIf config.networking.usePBBUplink (pkgs.dns.lib.combinators.host "195.39.246.42" "2a0f:4ac0:acab::42");
   dns.zones."ctu.cx".subdomains."home"                               = lib.mkIf config.networking.usePBBUplink (pkgs.dns.lib.combinators.host "195.39.246.42" "2a0f:4ac0:acab::42");
 
-  age.secrets.restic-server-hector.file   = ../../secrets/restic-server/hector.age;
-  age.secrets.restic-server-lollo.file    = ../../secrets/restic-server/lollo.age;
+  age.secrets.restic-server-hector.file      = ../../secrets/restic-server/hector.age;
+  age.secrets.restic-server-lollo.file       = ../../secrets/restic-server/lollo.age;
+  age.secrets.restic-server-wanderduene.file = ../../secrets/restic-server/wanderduene.age;
 
   age.secrets.wireguard-privkey.file      = ../../secrets/lollo/wireguard-privkey.age;
 
diff --git a/machines/trabbi/configuration.nix b/machines/trabbi/configuration.nix
@@ -27,8 +27,9 @@
 
   dns.zones."ctu.cx".subdomains."${config.networking.hostName}" = (pkgs.dns.lib.combinators.host "89.58.62.171" "2a0a:4cc0:1:2d7::1");
 
-  age.secrets.restic-server-lollo.file    = ../../secrets/restic-server/lollo.age;
-  age.secrets.restic-server-hector.file   = ../../secrets/restic-server/hector.age;
+  age.secrets.restic-server-lollo.file       = ../../secrets/restic-server/lollo.age;
+  age.secrets.restic-server-hector.file      = ../../secrets/restic-server/hector.age;
+  age.secrets.restic-server-wanderduene.file = ../../secrets/restic-server/wanderduene.age;
 
   boot = {
     loader = {
diff --git a/modules/linux/restic-backups.nix b/modules/linux/restic-backups.nix
@@ -44,7 +44,7 @@ let
 
       targets = mkOption {
         type    = with types; listOf str;
-        default = [ "lollo.ctu.cx" "hector.ctu.cx" ];
+        default = [ "wanderduene.ctu.cx" "lollo.ctu.cx" "hector.ctu.cx" ];
       };
 
       timerConfig = mkOption {

@@ -98,13 +98,17 @@ in {
                 set -eu pipefail
 
                 cp ${backup.passwordFile} /tmp/passwordFile;
+
                 ${if builtins.elem "lollo.ctu.cx" backup.targets then ''
-                  cp /run/agenix/restic-server-lollo    /tmp/lollo.ctu.cx;
+                  cp /run/agenix/restic-server-lollo /tmp/lollo.ctu.cx;
                 '' else "" }
 
-
                 ${if builtins.elem "hector.ctu.cx" backup.targets then ''
-                  cp /run/agenix/restic-server-hector   /tmp/hector.ctu.cx;
+                  cp /run/agenix/restic-server-hector /tmp/hector.ctu.cx;
+                '' else "" }
+
+                ${if builtins.elem "wanderduene.ctu.cx" backup.targets then ''
+                  cp /run/agenix/restic-server-wanderduene /tmp/wanderduene.ctu.cx;
                 '' else "" }
 
                 chown -R ${backup.user} /tmp