nixos/network-interfaces: add assertion if used in after or wants

This commit is contained in:
Maciej Krüger 2023-12-24 13:54:48 +01:00
parent 9e2cd6f872
commit c0ef1f9479
No known key found for this signature in database
GPG key ID: 0D948CE19CF49C5F

View file

@ -451,6 +451,21 @@ in
cfg.services
);
assertions = concatLists (
mapAttrsToList
(name: service:
map (message: {
assertion = false;
inherit message;
}) (concatLists [
(optional ((builtins.elem "network-interfaces.target" service.after) || (builtins.elem "network-interfaces.target" service.wants))
"Service '${name}.service' is using the deprecated target network-interfaces.target, which no longer exists. Using network.target is recommended instead."
)
])
)
cfg.services
);
system.build.units = cfg.units;
system.nssModules = [ cfg.package.out ];