nixos module: evaluate assertions from Home Manager modules

(cherry picked from commit 0898b6b482)
This commit is contained in:
Maximilian Bosch 2019-02-28 01:52:48 +01:00 committed by Robert Helgesson
parent fa19c18343
commit da31e466a1
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -44,6 +44,16 @@ in
}; };
config = mkIf (cfg.users != {}) { config = mkIf (cfg.users != {}) {
assertions =
flatten (flip mapAttrsToList cfg.users (user: config:
flip map config.assertions (assertion:
{
inherit (assertion) assertion;
message = "${user} profile: ${assertion.message}";
}
)
));
users.users = mkIf cfg.useUserPackages ( users.users = mkIf cfg.useUserPackages (
mapAttrs (username: usercfg: { mapAttrs (username: usercfg: {
packages = usercfg.home.packages; packages = usercfg.home.packages;