mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
services/gallery-dl: add job persistence
This commit is contained in:
parent
e9c2c3d226
commit
d9811b1d84
@ -39,6 +39,18 @@ let
|
||||
example = "*-*-3/4";
|
||||
};
|
||||
|
||||
persistent = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Indicates whether job is persistent, starting the service despite the
|
||||
timer missed. Defaults to <literal>true</literal> assuming it is used
|
||||
on the desktop.
|
||||
'';
|
||||
default = true;
|
||||
defaultText = "true";
|
||||
example = "false";
|
||||
};
|
||||
|
||||
extraArgs = lib.mkOption {
|
||||
type = with lib.types; listOf str;
|
||||
description = ''
|
||||
@ -185,7 +197,8 @@ in {
|
||||
|
||||
Timer = {
|
||||
OnCalendar = value.startAt;
|
||||
Persistent = true;
|
||||
Persistent = value.persistent;
|
||||
RandomizedDelaySec = "2min";
|
||||
};
|
||||
|
||||
Install.WantedBy = [ "timers.target" ];
|
||||
|
@ -38,6 +38,17 @@ let
|
||||
example = "*-*-3/4";
|
||||
};
|
||||
|
||||
persistent = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Indicates whether job is persistent, starting the service despite the
|
||||
timer missed.
|
||||
'';
|
||||
default = false;
|
||||
defaultText = "false";
|
||||
example = "true";
|
||||
};
|
||||
|
||||
extraArgs = lib.mkOption {
|
||||
type = with lib.types; listOf str;
|
||||
description = ''
|
||||
@ -195,5 +206,13 @@ in {
|
||||
SystemCallErrorNumber = "EPERM";
|
||||
};
|
||||
}) cfg.jobs;
|
||||
|
||||
systemd.timers = lib.mapAttrs' (name: value:
|
||||
lib.nameValuePair "gallery-dl-archive-service-${name}" {
|
||||
timerConfig = {
|
||||
Persistent = value.persistent;
|
||||
RandomizedDelaySec = "2min";
|
||||
};
|
||||
}) cfg.jobs;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user