hosts/ni/services/backup: update backup service

This commit is contained in:
Gabriel Arazas 2024-03-11 08:51:02 +08:00
parent a7d75dff58
commit c8152959d2
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 36 additions and 35 deletions

View File

@ -5,7 +5,11 @@ let
hostCfg = config.hosts.ni;
cfg = hostCfg.services.backup;
borgJobCommonSetting = { patterns ? [ ], passCommand }@args: args // {
borgJobCommonSetting = { patterns ? [ ], passCommand, ... }@args:
let
args' = lib.attrsets.removeAttrs args [ "patterns" "passCommand" ];
in
{
compression = "zstd,12";
dateFormat = "+%F-%H-%M-%S-%z";
doInit = false;
@ -35,7 +39,7 @@ let
yearly = 3;
};
};
};
} // args';
hetzner-boxes-user = "u332477";
hetzner-boxes-server = "${hetzner-boxes-user}.your-storagebox.de";
@ -51,13 +55,12 @@ in
./secrets.yaml
(foodogsquaredLib.sops-nix.attachSopsPathPrefix pathPrefix {
"patterns/home" = { };
"patterns/etc" = { };
"patterns/root" = { };
"patterns/keys" = { };
"patterns/remote-backup" = { };
"repos/archive/password" = { };
"repos/external-drive/password" = { };
"repos/archives/password" = { };
"repos/external-hdd/password" = { };
"repos/hetzner-box/password" = { };
"ssh-key" = { };
"repos/hetzner-box/ssh-key" = { };
});
suites.filesystem.setups = {
@ -72,20 +75,21 @@ in
secrets."${pathPrefix}/patterns/root".path
secrets."${pathPrefix}/patterns/keys".path
];
passCommand = "cat ${config.sops.secrets."${pathPrefix}/repos/archive/password".path}";
passCommand = "cat ${config.sops.secrets."${pathPrefix}/repos/archives/password".path}";
removableDevice = true;
repo = "/mnt/archives/backups";
startAt = "04:30";
};
local-external-drive = borgJobCommonSetting {
local-external-hdd = borgJobCommonSetting {
patterns = with config.sops; [
secrets."${pathPrefix}/patterns/home".path
secrets."${pathPrefix}/patterns/root".path
secrets."${pathPrefix}/patterns/keys".path
];
passCommand = "cat ${config.sops.secrets."${pathPrefix}/repos/external-drive/password".path}";
passCommand = "cat ${config.sops.secrets."${pathPrefix}/repos/external-hdd/password".path}";
removableDevice = true;
doInit = true;
repo = "/mnt/external-storage/backups";
startAt = "04:30";
};
@ -93,20 +97,18 @@ in
remote-backup-hetzner-box = borgJobCommonSetting {
patterns = with config.sops; [
secrets."${pathPrefix}/patterns/home".path
secrets."${pathPrefix}/patterns/root".path
secrets."${pathPrefix}/patterns/keys".path
];
passCommand = "cat ${config.sops.secrets."${pathPrefix}/repos/hetzner-box/password".path}";
doInit = true;
repo = "ssh://${hetzner-boxes-user}@${hetzner-boxes-server}:23/./borg/desktop/ni";
startAt = "04:30";
environment.BORG_RSH = "ssh -i ${config.sops.secrets."${pathPrefix}/ssh-key".path}";
environment.BORG_RSH = "ssh -i ${config.sops.secrets."${pathPrefix}/repos/hetzner-box/ssh-key".path}";
};
};
programs.ssh.extraConfig = ''
Host ${hetzner-boxes-server}
IdentityFile ${config.sops.secrets."${pathPrefix}/ssh-key".path}
IdentityFile ${config.sops.secrets."${pathPrefix}/repos/hetzner-box/ssh-key".path}
'';
};
}

View File

@ -1 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOCPRzVqx7dE2l6ja62d0iYStQxUHU2bCIoaZ/QTN+38 Desktop backup
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ7t+v5lQfX1voEdV6WHmdu5doV7N+B9Rq4auZB4x782 Desktop (ni) backup

View File

@ -1,33 +1,32 @@
ssh-key: ENC[AES256_GCM,data:oEFV3sCuwIVdKJR25oOYLfroos0G7m1QtGkTTR0TVM5ZJXSzBF3MtNr2wXRjvNFK3QAcgGuFQz42OfdgZJI/d7z/Rwxyp5H9TOguCDDDrkQ1vp1S75z3VEkXZKoVS9IyncF+Wc/qoqLngTEFA67XcXoAXIpAits+lgMm4Ek2RE7idwuLv2NsLlMFTYhu4zzG4ycsAynnvNneID9IwXGK82FHmusyPko80jDDxvibMOpHtnt3yoBWTHzHiJHGcWY6+Lm0DQBqfwnZ4SiAG5rGNNpYsMGT4Hp76RrC0s1bPqzW0bcMPJ1Il4KluTu1/r6dDVfuw3L2Q1S65LaGhiGid6fwAzbSfSLPRvmq0Cbre3xkhzt2xE8Cf+VKTTuXo5pJZdfzXhhSqoEI7lau+0uHmca1X68qaqpyJ3x3kCfQUz4xebOMt7z0rIvXwKuv07b4Pa3Y0TiK/kV/Howg3UyOGOlPYxH1mqQolC8KBsaM4j7TXFeofor8gCwM539iVWjXhvcyeH68UG5ayWWQMNK8BsPasNHiEyy3b909,iv:lXKaTo+TgxLEfdVRVwP64MJZ9DdinIi9LDlzTnN9rGs=,tag:9gH77XGDPBlCKYo6tXL+gg==,type:str]
repos:
archive:
password: ENC[AES256_GCM,data:SDeOjiMuHRNbUIozozzt2gPv1hA4fnhk1WPd9v2Hoj7FQd8G,iv:4EjrKKvFScYf5qc+ild3xxNOj7ueNQZFJRCtXk2PNMk=,tag:gaxzCzs/ZnSHTPwAos4Yow==,type:str]
external-drive:
password: ENC[AES256_GCM,data:BjL6PhkA9GYdSQEyHIrt00vA1JY9kLIqjHC6R2mUPuupbt1E,iv:37l5GTCxLPo3hOENHxZEH5CjcL6lP8sf5BoLA3YMXqM=,tag:LaMsCfaV4eVF0KBKnVlwlA==,type:str]
hetzner-box:
password: ENC[AES256_GCM,data:4rT5C0Qa4eAVk1NYvDJ6jFAcZtjUreaTMvn9,iv:l6q4bjqKxYQAxSVW+FOXvn9waLKa/a2s7exWtFJdDzw=,tag:tHXjc6HbSHnpS8oRWywg0A==,type:str]
patterns:
home: ENC[AES256_GCM,data:i7hlH0EWgYaj4Ow1iW6WvtFlPpEIFRWHepQMfpIXek/Ir5aNxG3dkrOzvgdEmWo+wDc6J9PtV2y7TDXCbOFbQA7Uai/6h+xWu7ost977t5zMkKm+85dN1GD4TLV89QmIZj410XNh5RiU7ociCnZq4zV6Mk5WpBo2XWt42L1kRX6REO39X4HmTTazBQdU56Jz8zhSx/NvmQR/q8y7y2qL/rOAaWv5+KnWjn0vLZzAA9aXDqRUGHA+DKoId0LakwFtVeRV9y/ok1Mm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RdUek6HoDypPK9zw9WGRJthk+7vtCWhyZLLndz0j0ST0H5mU9L9rwDJ4GiyKvPgAyk4iP4=,iv:FclOzefSaDDc+VXq/EMdKX95GfzInPvdKdaBqkNTQRI=,tag:p/0upm4ef/ESx0m9MUPROg==,type:str]
root: ENC[AES256_GCM,data:mHDo6whty2eiz8ZRhM3bpJ2fPNx5KMzkG0+J/E/CfR7EG02yY3y2Xu+fYQ==,iv:iX9tqqR5Qqbk8uyDczLpotOw68Aj2glpp/ZcOvQ+NQo=,tag:Ni2rcy4UK0HUOVuET5AwwQ==,type:str]
repos:
archives:
password: ENC[AES256_GCM,data:FuPW5dgbt20+eOT4ulV653amUocILnSgc2sBYaeusXw=,iv:WZJYpYdWQzs8G23P4Zflhlxe/H1tShPvMjmFEiLHl4A=,tag:lZUC9JBIwhcEiBpPajaKUw==,type:str]
hetzner-box:
password: ENC[AES256_GCM,data:GuNsNiVGHyUPrkVMlUQfAEIs/1bGfp3qYseXi/T+lQ==,iv:qrTs+T89R8wzvCxKzYoJyVzBGMczIDqhqfXB93pyxBU=,tag:KdO2cQjMjkJviBF+/5wzdA==,type:str]
ssh-key: ENC[AES256_GCM,data:b6A6ryV8gtBLWs0zje6KmTGvsMCDjS7KkisctZYkQ6Mt+1V5r49mVkgsZJF4zemK0FENR1usBeOQW9ylkmZD4attYrIp20KgMs7lmehpViE3xk8MA/m6TFUjR0bXh/FW+bwQ2JPFh09kmEmvPsj0gbGXp6Ine63PxQOPc2wZxxkgm1hjnDFeZVhknw5L3UrmvsOD2ex6lrCip6LwsKcz+9v4KRixQJkAQreALQ8lyw32FYKB8GwPsTSDjGpqiQAZWq1u8jEZcPmITW60qVH42V4jD0tny0HkQIaY5TpssPWbNrB1DPyKTtq1ZyRWRcTVtGQAGLcmcA2+vErdGDuM0YbvJmSbzRIj3EE9dR9gQJ19N1LRoJnQn2qLE5TovYFFa4V7tTx8GMa34dUmHfaIhotk+itCL/le9dhROdb2W1FabpRM7NkObJKdyV9HR88WpAZFr9wpnuOyEKW2qFFVqsPpmHP21VkKfbGJxm3LL6zw4MHN/WsFvfMF2NQCshOXixubQNiDaEQcMjlx3tS7easuB3Lavg3vQa4F,iv:hV4FupMtLb8lpe3JWlkbFLBu37kae06InNiZTOlppo0=,tag:k1rVBDz4mjD1ovxiTSEtZA==,type:str]
external-hdd:
password: ENC[AES256_GCM,data:P9LNQIs456JBWFJs1ARQHLiNeLWlkhPWaEgX431VYg5YNA==,iv:cN3v9jMZlHRVUHdhvXnDizl0GdpVlw5U70yYlxAv3ek=,tag:mYaq2M8xSBfl5+lAa1NNVQ==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1dm9xugju4q5gx0zty8ckw655ea904c64gv9qw9fn3lu507ck8uzsag59y8
- recipient: age1jxna9vm7nx4g69s84qgjptxvuzszcypf2rfk4ss2lyhnpe3yxdnqusu6jp
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAvSnZFWGxpMTBGNUF3RFhB
UG5SVWRhUDJ2bElnSVdqSHFhcXJYVU1MS3hRCmZEbGZpYlZPTWxZNzJ1UGFQNlF1
OXIyVUM3RkRCTkY3eGtWSXRpVm4yMTgKLS0tIEs2elQzOGw0T3UydVIyTUYxOUth
T1dFM2lCSGU4Yy9Zd2c4aUQ3YTlRaHMKL8RVIJE4v8aauIo7jmTvveuniwfs9A/W
SvdsKE/HxWplCZDvvW8y5OeT2hDemmn7a+46OrIWduao1qpK9PoCDQ==
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBnVExxY094cElKaG9KVUVC
R0R1RXd6YjViRnlpM2VKaDY3NlNUZXpoSEcwCithUUhzbERveVlRZm40bzQ0bitH
OEh4MlRLNjdsQjYvNENZMk5DMytoMjAKLS0tIHV6NkdYUGN3d1RpNmFxTWY4YW1s
emJQY1B4UHQvVDJxQlVlUjZXcW5hV2MKAqRYMFGWoXALeUeDoFCYFvCT8pIIRGk4
xMZwLHvRWuZW+15DYGrfrA9+DOS6SZYEYQeApMFVWUdYMU/Xn6KZig==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-01-04T09:43:43Z"
mac: ENC[AES256_GCM,data:w4VI/9GJ9iIBi7c0aCU9+wsAzZLVhIoZNlif6nPG2R/D7xiuLudizsUrljEujIINFxqaMhhJjl2lGBhBdUsY9Q8TB6WP+NVm0R3vvODhGc1Z3r87lbSL/TpYvFyM7TVsCx4gkiUgwE1i4nxdMeFtyi4P3lhm+k0TlBDhtZLaNtE=,iv:SwEIja9cnYaBtTQty+opkNscAZTOMnPzRzhbI4OJfQI=,tag:E2Ip2SPSnWQuTsPmFpxPKg==,type:str]
lastmodified: "2024-03-11T01:00:45Z"
mac: ENC[AES256_GCM,data:uvK0SmRAF/9xLrc5iF7GJBi0SbNKZ2U2Dudai6owToknCqiU5N0w9JudY7+eTxtD/RZkB2h2Kvq1aMEpbahdl8zZ4F6o7vxs1oeNcXAuB1gHGOfpG8AI+gojUrKZP5SKWsCqUOTjRtxAR9AjG0pR/rhbJjJ8EbQ9UawsaqQHMFk=,iv:VYSmLqDsViLwSJ1qsmjLFmlchJfM7QMmAD6HYC7jaWQ=,tag:hLGh+qdJsRXquXhWbnikUw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1