diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2016-07-06 18:50:05 +0200 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2016-07-11 22:42:47 +0200 |
commit | 2eb8aab42cf8623704904b41f4ffe9783bad7b07 (patch) | |
tree | 634d05ac1edf9fe033dd88bad9f4025dff61ac4a /nixos/modules/system | |
parent | 15d28334a716351371e4074a1e963a02193fe3fd (diff) | |
download | nixlib-2eb8aab42cf8623704904b41f4ffe9783bad7b07.tar nixlib-2eb8aab42cf8623704904b41f4ffe9783bad7b07.tar.gz nixlib-2eb8aab42cf8623704904b41f4ffe9783bad7b07.tar.bz2 nixlib-2eb8aab42cf8623704904b41f4ffe9783bad7b07.tar.lz nixlib-2eb8aab42cf8623704904b41f4ffe9783bad7b07.tar.xz nixlib-2eb8aab42cf8623704904b41f4ffe9783bad7b07.tar.zst nixlib-2eb8aab42cf8623704904b41f4ffe9783bad7b07.zip |
nixos/systemd: disable timer units with service
A disabled systemd service with a "startAt" attribute, like this: systemd.services.foo-service = { enable = false; startAt = "*-*-* 05:15:00"; ... }; will cause the following errors in the system journal: systemd[1]: foo-service.timer: Refusing to start, unit to trigger not loaded. systemd[1]: Failed to start foo-service.timer. Fix it by not generating the corresponding timer unit when the service is disabled.
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/boot/systemd.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index b7c09d2e4bfa..5c8cce5066af 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -764,7 +764,7 @@ in { wantedBy = [ "timers.target" ]; timerConfig.OnCalendar = service.startAt; }) - (filterAttrs (name: service: 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 = |