This commit is contained in:
2025-08-19 00:51:11 -05:00
parent 9a3c639efe
commit a394733024

View File

@@ -5,7 +5,7 @@
userType = types.submodule ({ name, ... }: { userType = types.submodule ({ name, ... }: {
options = with lib; { options = with lib; {
usrname = mkOption { name = mkOption {
type = with types; passwdEntry str; type = with types; passwdEntry str;
default = name; default = name;
}; };
@@ -64,7 +64,7 @@
config = { config = {
users.users = builtins.mapAttrs (name: user: { users.users = builtins.mapAttrs (name: user: {
name = user.usrname; name = user.name;
isNormalUser = true; isNormalUser = true;
uid = user.uid; uid = user.uid;
hashedPasswordFile = lib.mkIf (user.hashedPasswordFile != null) user.hashedPasswordFile; hashedPasswordFile = lib.mkIf (user.hashedPasswordFile != null) user.hashedPasswordFile;
@@ -83,25 +83,26 @@
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
inputs.home-manager-config inputs.home-manager-config
]; ];
users = (builtins.mapAttrs users = builtins.listToAttrs (builtins.map
(name: user: (lib.mkMerge ([ (x: {
name = x;
value = (lib.mkMerge ([
{ {
homeconfig = { homeconfig = {
host = config.sysconfig.host; host = config.sysconfig.host;
name = user.usrname; name = x;
graphical = config.sysconfig.graphical; graphical = config.sysconfig.graphical;
}; };
} }
] ++ (if inputs ? ${user.usrname} then [ (inputs.${user.usrname} { config = config.home-manager.users.${user.usrname}; inherit lib pkgs inputs; }) ] else []) ] ++ (if inputs ? ${x} then [ (inputs.${x} { config = config.home-manager.users.${x}; inherit lib pkgs inputs; }) ] else [])
++ user.home-manager.extraModules))) ++ config.sysconfig.users.${x}.home-manager.extraModules));
(builtins.removeAttrs })
config.sysconfig.users
(builtins.partition (builtins.partition
(x: (config.sysconfig.users.${x}.home-manager.enable && !config.sysconfig.users.${x}.home-manager.standalone)) (y: (config.sysconfig.users.${y}.home-manager.enable && !config.sysconfig.users.${y}.home-manager.standalone))
(builtins.attrNames config.sysconfig.users) (builtins.attrNames config.sysconfig.users)
).wrong ).wrong
)
); );
}; };
}; };
} }