mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 21:50:55 +00:00
Simplify assertion
This commit is contained in:
parent
eda854d50f
commit
2fc520d699
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue