modules/backup: set borg remote path and repo globally
This commit is contained in:
parent
33bcfd3123
commit
3dc9346801
1 changed files with 11 additions and 2 deletions
|
@ -21,10 +21,12 @@ let
|
|||
excludes
|
||||
);
|
||||
|
||||
BORG_REMOTE_PATH = "/usr/local/bin/borg1/borg1";
|
||||
|
||||
commonArgs = {
|
||||
environment = {
|
||||
BORG_RSH = "ssh -i ${config.secrets.borg-ssh-key}";
|
||||
BORG_REMOTE_PATH = "/usr/local/bin/borg1/borg1";
|
||||
inherit BORG_REMOTE_PATH;
|
||||
};
|
||||
extraCreateArgs = "--verbose --stats --checkpoint-interval 600";
|
||||
compression = "auto,zstd,3";
|
||||
|
@ -36,15 +38,22 @@ let
|
|||
passCommand = "cat ${config.secrets.borg-password}";
|
||||
};
|
||||
};
|
||||
|
||||
repo = "rsync.net:backups/hosts";
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
borgbackup
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
inherit BORG_REMOTE_PATH;
|
||||
BORG_REPO = repo;
|
||||
};
|
||||
|
||||
services.borgbackup.jobs."persist" = commonArgs // rec {
|
||||
paths = "/persist";
|
||||
repo = "rsync.net:backups/hosts/${config.networking.hostName}";
|
||||
inherit repo;
|
||||
exclude = map (append paths) excludes';
|
||||
startAt = "daily";
|
||||
prune.keep = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue