about summary refs log tree commit diff
path: root/hosts/tahoe
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-05-12 11:37:57 -0700
committerFranck Cuny <franck@fcuny.net>2023-05-12 11:37:57 -0700
commitce64d9bbb27e2b268cb5d16f4960c7ce8fd385d1 (patch)
treeb1a63c25f2b65a360f91157d0755ae078a2a8332 /hosts/tahoe
parentprofiles/backup: fix path to the ssh keys (diff)
downloadworld-ce64d9bbb27e2b268cb5d16f4960c7ce8fd385d1.tar.gz
hosts: move around backup configuration
Diffstat (limited to 'hosts/tahoe')
-rw-r--r--hosts/tahoe/default.nix19
-rw-r--r--hosts/tahoe/services.nix16
2 files changed, 20 insertions, 15 deletions
diff --git a/hosts/tahoe/default.nix b/hosts/tahoe/default.nix
index ae4bef8..ade4b5b 100644
--- a/hosts/tahoe/default.nix
+++ b/hosts/tahoe/default.nix
@@ -1,4 +1,7 @@
 { config, pkgs, hostname, self, ... }:
+let
+  secrets = config.age.secrets;
+in
 {
   imports = [
     ./boot.nix
@@ -17,6 +20,22 @@
     "${self}/profiles/hardware/amd.nix"
   ];
 
+  my.services.backup = {
+    enable = true;
+    repository = "/data/slow/backups/hosts/${config.networking.hostName}";
+    timerConfig = { OnCalendar = "00:15"; };
+    passwordFile = secrets."restic/repo-systems".path;
+    paths =
+      [
+        "/data/fast/music"
+        "/data/fast/photos"
+        "/home/fcuny/documents"
+        "/home/fcuny/workspace"
+        "/home/fcuny/media"
+      ];
+    exclude = [ ];
+  };
+
   # This value determines the NixOS release from which the default
   # settings for stateful data, like file locations and database versions
   # on your system were taken. It‘s perfectly fine and recommended to leave
diff --git a/hosts/tahoe/services.nix b/hosts/tahoe/services.nix
index 4b29870..4056df3 100644
--- a/hosts/tahoe/services.nix
+++ b/hosts/tahoe/services.nix
@@ -23,21 +23,7 @@ in
       promtail.enable = true;
       node-exporter.enable = true;
     };
-    backup = {
-      enable = true;
-      repository = "/data/slow/backups/hosts/tahoe";
-      timerConfig = { OnCalendar = "00:15"; };
-      passwordFile = secrets."restic/repo-systems".path;
-      paths =
-        [
-          "/data/fast/music"
-          "/data/fast/photos"
-          "/home/fcuny/documents"
-          "/home/fcuny/workspace"
-          "/home/fcuny/media"
-        ];
-      exclude = [ ];
-    };
+
     sendsms.enable = true;
   };
 }