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