mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
Merge pull request #19668 from groxxda/timers
systemd.timers: automatically convert string to list
This commit is contained in:
commit
99d9d32899
@ -41,7 +41,7 @@ in
|
||||
systemd.services.nix-optimise =
|
||||
{ description = "Nix Store Optimiser";
|
||||
serviceConfig.ExecStart = "${config.nix.package}/bin/nix-store --optimise";
|
||||
startAt = optional cfg.automatic cfg.dates;
|
||||
startAt = optionals cfg.automatic cfg.dates;
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -316,7 +316,7 @@ in rec {
|
||||
|
||||
startAt = mkOption {
|
||||
type = with types; either str (listOf str);
|
||||
default = "";
|
||||
default = [];
|
||||
example = "Sun 14:00:00";
|
||||
description = ''
|
||||
Automatically start this unit at the given date/time, which
|
||||
@ -326,6 +326,7 @@ in rec {
|
||||
to adding a corresponding timer unit with
|
||||
<option>OnCalendar</option> set to the value given here.
|
||||
'';
|
||||
apply = v: if isList v then v else [ v ];
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -777,7 +777,7 @@ in
|
||||
{ wantedBy = [ "timers.target" ];
|
||||
timerConfig.OnCalendar = service.startAt;
|
||||
})
|
||||
(filterAttrs (name: service: service.enable && service.startAt != "") cfg.services);
|
||||
(filterAttrs (name: service: service.enable && service.startAt != []) cfg.services);
|
||||
|
||||
# Generate timer units for all services that have a ‘startAt’ value.
|
||||
systemd.user.timers =
|
||||
@ -785,7 +785,7 @@ in
|
||||
{ wantedBy = [ "timers.target" ];
|
||||
timerConfig.OnCalendar = service.startAt;
|
||||
})
|
||||
(filterAttrs (name: service: service.startAt != "") cfg.user.services);
|
||||
(filterAttrs (name: service: service.startAt != []) cfg.user.services);
|
||||
|
||||
systemd.sockets.systemd-journal-gatewayd.wantedBy =
|
||||
optional config.services.journald.enableHttpGateway "sockets.target";
|
||||
|
Loading…
Reference in New Issue
Block a user