function
This commit is contained in:
@@ -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;
|
||||||
homeconfig = {
|
value = (lib.mkMerge ([
|
||||||
host = config.sysconfig.host;
|
{
|
||||||
name = user.usrname;
|
homeconfig = {
|
||||||
graphical = config.sysconfig.graphical;
|
host = config.sysconfig.host;
|
||||||
};
|
name = x;
|
||||||
}
|
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
|
] ++ (if inputs ? ${x} then [ (inputs.${x} { config = config.home-manager.users.${x}; inherit lib pkgs inputs; }) ] else [])
|
||||||
config.sysconfig.users
|
++ config.sysconfig.users.${x}.home-manager.extraModules));
|
||||||
(builtins.partition
|
})
|
||||||
(x: (config.sysconfig.users.${x}.home-manager.enable && !config.sysconfig.users.${x}.home-manager.standalone))
|
(builtins.partition
|
||||||
(builtins.attrNames config.sysconfig.users)
|
(y: (config.sysconfig.users.${y}.home-manager.enable && !config.sysconfig.users.${y}.home-manager.standalone))
|
||||||
).wrong
|
(builtins.attrNames config.sysconfig.users)
|
||||||
)
|
).wrong
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user