From da444ff26f88579b1f3da632ca671f8d49ca1e2b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 22 Apr 2014 23:23:05 +0200 Subject: Turn assertion about oneshot services into a warning --- nixos/modules/system/boot/systemd.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 4e395899bd3d..52ba31cdeede 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -688,10 +688,9 @@ in config = { - assertions = mapAttrsToList (name: service: { - assertion = service.serviceConfig.Type or "" == "oneshot" -> service.serviceConfig.Restart or "no" == "no"; - message = "${name}: Type=oneshot services must have Restart=no"; - }) cfg.services; + warnings = concatLists (mapAttrsToList (name: service: + optional (service.serviceConfig.Type or "" == "oneshot" && service.serviceConfig.Restart or "no" != "no") + "Service ‘${name}.service’ with ‘Type=oneshot’ must have ‘Restart=no’") cfg.services); system.build.units = cfg.units; -- cgit 1.4.1