···
enable = mkEnableOption (lib.mdDoc "periodic tarsnap backups");
35
+
package = mkPackageOption pkgs "tarsnap" { };
default = "/root/tarsnap.key";
···
requires = [ "network-online.target" ];
after = [ "network-online.target" ];
310
-
path = with pkgs; [ iputils tarsnap util-linux ];
312
+
path = with pkgs; [ iputils gcfg.package util-linux ];
# In order for the persistent tarsnap timer to work reliably, we have to
# make sure that the tarsnap server is reachable after systemd starts up
···
321
-
tarsnap = ''tarsnap --configfile "/etc/tarsnap/${name}.conf"'';
323
+
tarsnap = ''${lib.getExe gcfg.package} --configfile "/etc/tarsnap/${name}.conf"'';
run = ''${tarsnap} -c -f "${name}-$(date +"%Y%m%d%H%M%S")" \
${optionalString cfg.verbose "-v"} \
${optionalString cfg.explicitSymlinks "-H"} \
···
description = "Tarsnap restore '${name}'";
requires = [ "network-online.target" ];
358
-
path = with pkgs; [ iputils tarsnap util-linux ];
360
+
path = with pkgs; [ iputils gcfg.package util-linux ];
361
-
tarsnap = ''tarsnap --configfile "/etc/tarsnap/${name}.conf"'';
363
+
tarsnap = ''${lib.getExe gcfg.package} --configfile "/etc/tarsnap/${name}.conf"'';
lastArchive = "$(${tarsnap} --list-archives | sort | tail -1)";
run = ''${tarsnap} -x -f "${lastArchive}" ${optionalString cfg.verbose "-v"}'';
cachedir = escapeShellArg cfg.cachedir;
···
{ text = configFile name cfg;
405
-
environment.systemPackages = [ pkgs.tarsnap ];
407
+
environment.systemPackages = [ gcfg.package ];