From a39473302471e9c02c0520c4f00d109606b40246 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 19 Aug 2025 00:51:11 -0500 Subject: [PATCH] function --- system-config/users/default.nix | 41 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/system-config/users/default.nix b/system-config/users/default.nix index fad0a9b..88dfffc 100644 --- a/system-config/users/default.nix +++ b/system-config/users/default.nix @@ -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 ); + }; }; }