summaryrefslogtreecommitdiff
path: root/hosts/vidhar/borg/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/vidhar/borg/default.nix')
-rw-r--r--hosts/vidhar/borg/default.nix14
1 files changed, 8 insertions, 6 deletions
diff --git a/hosts/vidhar/borg/default.nix b/hosts/vidhar/borg/default.nix
index 7a508971..3804aa76 100644
--- a/hosts/vidhar/borg/default.nix
+++ b/hosts/vidhar/borg/default.nix
@@ -11,7 +11,7 @@ let
11 Host yggdrasil.borgbase 11 Host yggdrasil.borgbase
12 HostName nx69hpl8.repo.borgbase.com 12 HostName nx69hpl8.repo.borgbase.com
13 User nx69hpl8 13 User nx69hpl8
14 IdentityFile /run/credentials/${serviceName}.service/ssh-identity 14 IdentityFile ${config.sops.secrets."append.borgbase".path}
15 IdentitiesOnly yes 15 IdentitiesOnly yes
16 16
17 BatchMode yes 17 BatchMode yes
@@ -33,14 +33,10 @@ let
33 "BORG_CACHE_DIR=/var/lib/borg/cache" 33 "BORG_CACHE_DIR=/var/lib/borg/cache"
34 "BORG_SECURITY_DIR=/var/lib/borg/security" 34 "BORG_SECURITY_DIR=/var/lib/borg/security"
35 "BORG_KEYS_DIR=/var/lib/borg/keys" 35 "BORG_KEYS_DIR=/var/lib/borg/keys"
36 "BORG_KEY_FILE=/run/credentials/${serviceName}.service/keyfile" 36 "BORG_KEY_FILE=${config.sops.secrets."yggdrasil.borgkey".path}"
37 "BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes" 37 "BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes"
38 "BORG_HOSTNAME_IS_UNIQUE=yes" 38 "BORG_HOSTNAME_IS_UNIQUE=yes"
39 ]; 39 ];
40 LoadCredential = [
41 "ssh-identity:${config.sops.secrets."append.borgbase".path}"
42 "keyfile:${config.sops.secrets."yggdrasil.borgkey".path}"
43 ];
44 }; 40 };
45 }; 41 };
46 42
@@ -102,10 +98,16 @@ in {
102 sops.secrets."append.borgbase" = { 98 sops.secrets."append.borgbase" = {
103 format = "binary"; 99 format = "binary";
104 sopsFile = ./append.borgbase; 100 sopsFile = ./append.borgbase;
101 owner = "borg";
102 group = "borg";
103 mode = "0640";
105 }; 104 };
106 sops.secrets."yggdrasil.borgkey" = { 105 sops.secrets."yggdrasil.borgkey" = {
107 format = "binary"; 106 format = "binary";
108 sopsFile = ./yggdrasil.borgkey; 107 sopsFile = ./yggdrasil.borgkey;
108 owner = "borg";
109 group = "borg";
110 mode = "0640";
109 }; 111 };
110 112
111 systemd.services = listToAttrs (map copyService [{ repo = "/srv/backup/borg/jotnar"; repoEscaped = "srv-backup-borg-jotnar"; }]); 113 systemd.services = listToAttrs (map copyService [{ repo = "/srv/backup/borg/jotnar"; repoEscaped = "srv-backup-borg-jotnar"; }]);