Add an assertion to make sure that the services passed to systemd-manager exist.

This commit is contained in:
r-vdp 2023-03-22 11:56:58 +01:00
parent 542f0fea95
commit 19edbdddb1
No known key found for this signature in database

View file

@ -24,7 +24,9 @@
}; };
system.stateVersion = lib.mkDefault lib.trivial.release; system.stateVersion = lib.mkDefault lib.trivial.release;
assertions = lib.flip map config.system-manager.etcFiles (entry: assertions =
lib.flip map config.system-manager.etcFiles
(entry:
{ {
assertion = lib.hasAttr entry config.environment.etc; assertion = lib.hasAttr entry config.environment.etc;
message = lib.concatStringsSep " " [ message = lib.concatStringsSep " " [
@ -32,6 +34,16 @@
"is not present in environment.etc" "is not present in environment.etc"
]; ];
} }
) ++
lib.flip map config.system-manager.services
(entry:
{
assertion = lib.hasAttr entry config.systemd.services;
message = lib.concatStringsSep " " [
"The entry ${entry} that was passed to system-manager.services"
"is not present in systemd.services"
];
}
); );
# Add the system directory for systemd # Add the system directory for systemd