0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

Improve assertions for etc.overlay and systemd-sysusers (#332516)

This commit is contained in:
Jörg Thalheim 2024-09-23 17:01:30 +02:00 committed by GitHub
commit 15f80d9120
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 13 deletions

View file

@ -68,14 +68,10 @@ in
assertion = config.system.activationScripts.users == "";
message = "system.activationScripts.users has to be empty to use systemd-sysusers";
}
{
assertion = config.users.mutableUsers -> config.system.etc.overlay.enable;
message = "config.users.mutableUsers requires config.system.etc.overlay.enable.";
}
] ++ (lib.mapAttrsToList
(_username: opts: {
(username: opts: {
assertion = !opts.isNormalUser;
message = "systemd-sysusers doesn't create normal users. You can currently only use it to create system users.";
message = "${username} is a normal user. systemd-sysusers doesn't create normal users, only system users.";
})
userCfg.users)
++ lib.mapAttrsToList