mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 21:33:03 +03: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 New Issue
Block a user