From c1e638abb67d51320907c1245992bea4a8694c83 Mon Sep 17 00:00:00 2001 From: Mathijs Kwik Date: Thu, 17 Apr 2014 15:20:39 +0200 Subject: [PATCH] systemd: oneshot units should be allowed to restart on failure/abort --- nixos/modules/system/boot/systemd.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;