mirror of
https://github.com/RGBCube/ncc
synced 2025-07-28 02:27:44 +00:00
Start refactor
This commit is contained in:
parent
99b7ccfadb
commit
06cce18e72
155 changed files with 2139 additions and 3738 deletions
20
modules/linux/restic/default.nix
Normal file
20
modules/linux/restic/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib) genAttrs merge mkConst mkIf remove;
|
||||
in merge <| mkIf config.isServer {
|
||||
options.resticHosts = mkConst <| remove config.networking.hostName [ "cube" "disk" "nine" ];
|
||||
|
||||
config.secrets.resticPassword.file = ./password.age;
|
||||
|
||||
config.services.restic.backups = genAttrs config.resticHosts (host: {
|
||||
repository = "sftp:backup@${host}:${config.networking.hostName}-backup";
|
||||
passwordFile = config.secrets.resticPassword.path;
|
||||
initialize = true;
|
||||
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 4"
|
||||
"--keep-monthly 12"
|
||||
];
|
||||
});
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue