From 516b6e84d29d54bfd93ffdc8e046f8eccfeb98d3 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 3 Oct 2023 21:33:16 +0800 Subject: [PATCH] lib/private: refactor `mapHomeManagerUser` --- lib/private.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/private.nix b/lib/private.nix index ff50d0f9..9a61e6d7 100644 --- a/lib/private.nix +++ b/lib/private.nix @@ -14,16 +14,16 @@ rec { isNormalUser = lib.mkForce true; }; in - { - imports = [ - { users.users."${user}" = defaultUserConfig; } - ]; - + ({ lib, ... }: { home-manager.users."${user}" = { ... }: { imports = [ (getUser "home-manager" user) ]; }; - users.users."${user}" = settings; - }; + + users.users."${user}" = lib.mkMerge [ + defaultUserConfig + settings + ]; + }); getSecret = path: ../secrets/${path}; @@ -44,8 +44,7 @@ rec { (r: r) users'; - getUser = type: user: - lib.getAttr user (getUsers type [ user ]); + getUser = type: user: ../users/${type}/${user}; # Import modules with a set blocklist. importModules = attrs: