1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 21:50:55 +00:00

Simplify assertion

This commit is contained in:
Eelco Dolstra 2014-04-16 01:08:14 +02:00
parent eda854d50f
commit 2fc520d699

View file

@ -631,8 +631,7 @@ in
config = {
assertions = mapAttrsToList (name: service: {
assertion = !hasAttr "Type" service.serviceConfig || service.serviceConfig.Type != "oneshot"
|| !hasAttr "Restart" service.serviceConfig || service.serviceConfig.Restart == "no";
assertion = service.serviceConfig.Type or "" == "oneshot" -> service.serviceConfig.Restart or "no" == "no";
message = "${name}: Type=oneshot services must have Restart=no";
}) cfg.services;