0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/restic: add 'backups.package' option to override the restic package (#183028)

This commit is contained in:
Alan Strohm 2022-07-27 10:47:41 -07:00 committed by GitHub
parent 2f6dce6bd1
commit 81cd3e229c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View file

@ -222,6 +222,15 @@ in
A script that must run after finishing the backup process.
'';
};
package = mkOption {
type = types.package;
default = pkgs.restic;
defaultText = literalExpression "pkgs.restic";
description = ''
Restic package to use.
'';
};
};
}));
default = { };
@ -254,7 +263,7 @@ in
(name: backup:
let
extraOptions = concatMapStrings (arg: " -o ${arg}") backup.extraOptions;
resticCmd = "${pkgs.restic}/bin/restic${extraOptions}";
resticCmd = "${backup.package}/bin/restic${extraOptions}";
filesFromTmpFile = "/run/restic-backups-${name}/includes";
backupPaths =
if (backup.dynamicFilesFrom == null)