mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Turn assertion about oneshot services into a warning
This commit is contained in:
parent
1c84988594
commit
da444ff26f
1 changed files with 3 additions and 4 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue