about summary refs log tree commit diff
path: root/hosts/aptos
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/aptos
parentprofiles/backup: fix path to the ssh keys (diff)
downloadworld-ce64d9bbb27e2b268cb5d16f4960c7ce8fd385d1.tar.gz
hosts: move around backup configuration
Diffstat (limited to 'hosts/aptos')
-rw-r--r--hosts/aptos/default.nix32
-rw-r--r--hosts/aptos/services.nix32
2 files changed, 29 insertions, 35 deletions
diff --git a/hosts/aptos/default.nix b/hosts/aptos/default.nix
index 6326615..b2236f5 100644
--- a/hosts/aptos/default.nix
+++ b/hosts/aptos/default.nix
@@ -1,10 +1,12 @@
-{ self, ... }:
-
+{ self, config, ... }:
+let
+  secrets = config.age.secrets;
+  ssh-key-path = secrets."restic/ssh-key".path;
+in
 {
   imports = [
     ./hardware.nix
     ./networking.nix
-    ./services.nix
     "${self}/profiles/btrfs.nix"
     "${self}/profiles/documentation.nix"
     "${self}/profiles/laptop.nix"
@@ -12,6 +14,30 @@
     "${self}/profiles/hardware/xps9300.nix"
   ];
 
+  my.services.backup = {
+    enable = true;
+    repository = "sftp:192.168.6.40:/${config.networking.hostName}";
+    exclude = [
+      # paths that I don't want to backup
+      "/home/fcuny/workspace/tmp"
+
+      # various development related files
+      "**/target"
+      "**/.direnv"
+      "**/result"
+    ];
+    timerConfig = { OnCalendar = "06:30"; };
+    passwordFile = secrets."restic/repo-users".path;
+    extraOptions = [
+      "sftp.command='ssh backup@192.168.6.40 -i ${ssh-key-path} -s sftp'"
+    ];
+    paths = [
+      "/home/fcuny/workspace"
+      "/home/fcuny/media"
+      "/home/fcuny/documents"
+    ];
+  };
+
   # 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/aptos/services.nix b/hosts/aptos/services.nix
deleted file mode 100644
index 742b014..0000000
--- a/hosts/aptos/services.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-{ config, ... }:
-let
-  secrets = config.age.secrets;
-  ssh-key-path = secrets."restic/ssh-key".path;
-in
-{
-  my.services = {
-    backup = {
-      enable = true;
-      repository = "sftp:192.168.6.40:/aptos";
-      exclude = [
-        # paths that I don't want to backup
-        "/home/fcuny/workspace/tmp"
-
-        # various development related files
-        "**/target"
-        "**/.direnv"
-        "**/result"
-      ];
-      timerConfig = { OnCalendar = "06:30"; };
-      passwordFile = secrets."restic/repo-users".path;
-      extraOptions = [
-        "sftp.command='ssh backup@192.168.6.40 -i ${ssh-key-path} -s sftp'"
-      ];
-      paths = [
-        "/home/fcuny/workspace"
-        "/home/fcuny/media"
-        "/home/fcuny/documents"
-      ];
-    };
-  };
-}