nixos/modules: Reformat warnings
section
This commit is contained in:
parent
b37bbca521
commit
c178fe4bbb
@ -886,14 +886,21 @@ in
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
warnings = concatLists (mapAttrsToList (name: service:
|
warnings = concatLists (
|
||||||
let
|
mapAttrsToList
|
||||||
type = service.serviceConfig.Type or "";
|
(name: service:
|
||||||
restart = service.serviceConfig.Restart or "no";
|
let
|
||||||
in optional
|
type = service.serviceConfig.Type or "";
|
||||||
(type == "oneshot" && (restart == "always" || restart == "on-success"))
|
restart = service.serviceConfig.Restart or "no";
|
||||||
"Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'")
|
in
|
||||||
cfg.services);
|
concatLists [
|
||||||
|
(optional (type == "oneshot" && (restart == "always" || restart == "on-success"))
|
||||||
|
"Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'"
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
cfg.services
|
||||||
|
);
|
||||||
|
|
||||||
system.build.units = cfg.units;
|
system.build.units = cfg.units;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user