diff options
author | Tim Steinbach <NeQuissimus@users.noreply.github.com> | 2016-10-20 17:37:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-20 17:37:28 -0400 |
commit | 99d9d32899cc73e295364f22208df22b5bdf1583 (patch) | |
tree | b4673fd8d548425a486fc285596bd274207e7be3 /nixos/modules/system | |
parent | 53f77b719c9684cb9363c01d0d72170c8259dbe8 (diff) | |
parent | 8bb4fc1039f8f97534bd2ab5cc3f42e7d753a5a0 (diff) | |
download | nixpkgs-99d9d32899cc73e295364f22208df22b5bdf1583.tar nixpkgs-99d9d32899cc73e295364f22208df22b5bdf1583.tar.gz nixpkgs-99d9d32899cc73e295364f22208df22b5bdf1583.tar.bz2 nixpkgs-99d9d32899cc73e295364f22208df22b5bdf1583.tar.lz nixpkgs-99d9d32899cc73e295364f22208df22b5bdf1583.tar.xz nixpkgs-99d9d32899cc73e295364f22208df22b5bdf1583.tar.zst nixpkgs-99d9d32899cc73e295364f22208df22b5bdf1583.zip |
Merge pull request #19668 from groxxda/timers
systemd.timers: automatically convert string to list
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/boot/systemd-unit-options.nix | 3 | ||||
-rw-r--r-- | nixos/modules/system/boot/systemd.nix | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/nixos/modules/system/boot/systemd-unit-options.nix b/nixos/modules/system/boot/systemd-unit-options.nix index 731b1701e00..4c3fc30358c 100644 --- a/nixos/modules/system/boot/systemd-unit-options.nix +++ b/nixos/modules/system/boot/systemd-unit-options.nix @@ -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 ]; }; }; diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index d44c2e234b0..d1f3f923e5e 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -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"; |