@@ -20,6 +20,12 @@ in
2020 options = {
2121 services.rsnapshot = {
2222 enable = mkEnableOption "rsnapshot backups";
23+ enableManualRsnapshot = mkOption {
24+ description = "Whether to enable manual usage of the rsnapshot command with this module.";
25+ default = true;
26+ example = false;
27+ type = types.bool;
28+ };
2329
2430 extraConfig = mkOption {
2531 default = "";
@@ -54,8 +60,14 @@ in
5460 };
5561 };
5662
57− config = mkIf cfg.enable {
58− services.cron.systemCronJobs =
59− mapAttrsToList (interval: time: "${time} root ${pkgs.rsnapshot}/bin/rsnapshot -c ${cfgfile} ${interval}") cfg.cronIntervals;
60− };
63+ config = mkIf cfg.enable (mkMerge [
64+ {
65+ services.cron.systemCronJobs =
66+ mapAttrsToList (interval: time: "${time} root ${pkgs.rsnapshot}/bin/rsnapshot -c ${cfgfile} ${interval}") cfg.cronIntervals;
67+ }
68+ (mkIf cfg.enableManualRsnapshot {
69+ environment.systemPackages = [ pkgs.rsnapshot ];
70+ environment.etc."rsnapshot.conf".source = cfgfile;
71+ })
72+ ]);
6173}