mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-26 08:48:38 +03:00
nixos/restic: allow timer to be disabled
This commit is contained in:
parent
aca44fe219
commit
20b202b3c8
@ -133,13 +133,15 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
timerConfig = mkOption {
|
timerConfig = mkOption {
|
||||||
type = types.attrsOf unitOption;
|
type = types.nullOr (types.attrsOf unitOption);
|
||||||
default = {
|
default = {
|
||||||
OnCalendar = "daily";
|
OnCalendar = "daily";
|
||||||
Persistent = true;
|
Persistent = true;
|
||||||
};
|
};
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
When to run the backup. See {manpage}`systemd.timer(5)` for details.
|
When to run the backup. See {manpage}`systemd.timer(5)` for
|
||||||
|
details. If null no timer is created and the backup will only
|
||||||
|
run when explicitly started.
|
||||||
'';
|
'';
|
||||||
example = {
|
example = {
|
||||||
OnCalendar = "00:05";
|
OnCalendar = "00:05";
|
||||||
@ -378,7 +380,7 @@ in
|
|||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = backup.timerConfig;
|
timerConfig = backup.timerConfig;
|
||||||
})
|
})
|
||||||
config.services.restic.backups;
|
(filterAttrs (_: backup: backup.timerConfig != null) config.services.restic.backups);
|
||||||
|
|
||||||
# generate wrapper scripts, as described in the createWrapper option
|
# generate wrapper scripts, as described in the createWrapper option
|
||||||
environment.systemPackages = lib.mapAttrsToList (name: backup: let
|
environment.systemPackages = lib.mapAttrsToList (name: backup: let
|
||||||
|
@ -55,6 +55,7 @@ import ./make-test-python.nix (
|
|||||||
inherit passwordFile paths exclude pruneOpts backupPrepareCommand backupCleanupCommand;
|
inherit passwordFile paths exclude pruneOpts backupPrepareCommand backupCleanupCommand;
|
||||||
repository = remoteRepository;
|
repository = remoteRepository;
|
||||||
initialize = true;
|
initialize = true;
|
||||||
|
timerConfig = null; # has no effect here, just checking that it doesn't break the service
|
||||||
};
|
};
|
||||||
remote-from-file-backup = {
|
remote-from-file-backup = {
|
||||||
inherit passwordFile exclude pruneOpts;
|
inherit passwordFile exclude pruneOpts;
|
||||||
|
Loading…
Reference in New Issue
Block a user