From a77fbf968204a8c959f1f11b2c937eb988651abe Mon Sep 17 00:00:00 2001 From: niten Date: Sat, 2 Oct 2021 16:30:31 -0700 Subject: [PATCH] Only set up home dirs for local users --- module.nix | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/module.nix b/module.nix index 7376fb5..250155f 100644 --- a/module.nix +++ b/module.nix @@ -14,6 +14,20 @@ let hostname = config.instance.hostname; enable-gui = config.fudo.hosts.${hostname}.enable-gui; + user-config-map = { + niten = ./niten.nix; + # FIXME: Root shouldn't have all this stuff installed! + root = ./niten.nix; + viator = ./niten.nix; + xiaoxuan = ./xiaoxuan.nix; + }; + + local-users = let + local-usernames = attrNames config.instance.local-users; + in filterAttrs + (username: userOpts: elem username local-usernames) + user-config-map; + in { config.home-manager = { @@ -24,14 +38,18 @@ in { user-cfg = config.fudo.users.${username}; user-email = user-cfg.email; home-dir = user-cfg.home-directory; - in import user-configs.${username} - { inherit username user-email home-dir; }; - in mapAttrs generate-config { - niten = ./niten.nix; - # FIXME: Root shouldn't have all this stuff installed! - root = ./niten.nix; - viator = ./niten.nix; - xiaoxuan = ./xiaoxuan.nix; - }; + in (import user-configs.${username} { + inherit + config + lib + pkgs + doom-emacs + niten-doom-config + username + user-email + home-dir + enable-gui; + }); + in mapAttrs generate-config local-users; }; }