diff --git a/modules/core/default.nix b/modules/core/default.nix index af23cec..dec05b5 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -8,6 +8,7 @@ ./fonts.nix ./gdm.nix ./gnomeBoxes.nix + ./home-manager.nix ./hyprland.nix ./localsend.nix ./network.nix diff --git a/modules/core/home-manager.nix b/modules/core/home-manager.nix new file mode 100644 index 0000000..b1350e7 --- /dev/null +++ b/modules/core/home-manager.nix @@ -0,0 +1,43 @@ +{ + config, + host, + inputs, + homePath, + profile, + username, + ... +}: +let + zshCfg = config.modules.zsh; +in +{ + imports = [ inputs.home-manager.nixosModules.home-manager ]; + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + backupFileExtension = "backup"; + extraSpecialArgs = { + inherit + host + inputs + profile + username + ; + }; + users.${username} = { + imports = [ homePath ]; + modules.gpg.signingKey = config.modules.gpg.signingKey; + modules.display.scale = config.modules.display.scale; + }; + }; + + environment.pathsToLink = + # Since Home Manager is installed via its NixOS module, we need to add this so that + # the portal definitions and DE provided configurations get linked + [ + "/share/applications" + "/share/xdg-desktop-portal" + ] + # Needed to get completion for system packages (e.g. systemd) + ++ (if zshCfg.enable then [ "/share/zsh" ] else [ ]); +} diff --git a/modules/core/user.nix b/modules/core/user.nix index 7399f9e..32dafe5 100644 --- a/modules/core/user.nix +++ b/modules/core/user.nix @@ -1,37 +1,13 @@ { config, - host, - inputs, pkgs, - profile, username, ... }: let shellCfg = config.modules.shell; - zshCfg = config.modules.zsh; in { - imports = [ inputs.home-manager.nixosModules.home-manager ]; - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - backupFileExtension = "backup"; - extraSpecialArgs = { - inherit - host - inputs - profile - username - ; - }; - users.${username} = { - imports = [ ../../homes/${username}/home.nix ]; - modules.gpg.signingKey = config.modules.gpg.signingKey; - modules.display.scale = config.modules.display.scale; - }; - }; - users.mutableUsers = true; users.users.${username} = { isNormalUser = true; @@ -49,11 +25,4 @@ in # Set /etc/shells so GDM will show our user when ZSH is selected environment.shells = [ pkgs.${shellCfg.defaultShell} ]; - - environment.pathsToLink = - # Since Home Manager is installed via its NixOS module, we need to add this so that - # the portal definitions and DE provided configurations get linked - [ "/share/applications" "/share/xdg-desktop-portal" ] - # Needed to get completion for system packages (e.g. systemd) - ++ (if zshCfg.enable then [ "/share/zsh" ] else [ ]); }