diff options
author | Mathijs Kwik <mathijs@bluescreen303.nl> | 2014-04-17 15:20:39 +0200 |
---|---|---|
committer | Mathijs Kwik <mathijs@bluescreen303.nl> | 2014-04-17 15:20:39 +0200 |
commit | c1e638abb67d51320907c1245992bea4a8694c83 (patch) | |
tree | 72dbc83836bbee087a93999caa4907c397f09ed8 /nixos/modules | |
parent | d17af6b9a8bde0823d62c329506ce151a698b902 (diff) | |
download | nixlib-c1e638abb67d51320907c1245992bea4a8694c83.tar nixlib-c1e638abb67d51320907c1245992bea4a8694c83.tar.gz nixlib-c1e638abb67d51320907c1245992bea4a8694c83.tar.bz2 nixlib-c1e638abb67d51320907c1245992bea4a8694c83.tar.lz nixlib-c1e638abb67d51320907c1245992bea4a8694c83.tar.xz nixlib-c1e638abb67d51320907c1245992bea4a8694c83.tar.zst nixlib-c1e638abb67d51320907c1245992bea4a8694c83.zip |
systemd: oneshot units should be allowed to restart on failure/abort
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/system/boot/systemd.nix | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index f70efeca4b9f..5f07d6482b7f 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -637,7 +637,8 @@ in config = { assertions = mapAttrsToList (name: service: { - assertion = service.serviceConfig.Type or "" == "oneshot" -> service.serviceConfig.Restart or "no" == "no"; + assertion = service.serviceConfig.Type or "" == "oneshot" -> + builtins.elem (service.serviceConfig.Restart or "no") ["no" "on-failure" "on-abort"]; message = "${name}: Type=oneshot services must have Restart=no"; }) cfg.services; |