diff --git a/home-manager/base.nix b/home-manager/base.nix new file mode 100644 index 0000000..13a4a20 --- /dev/null +++ b/home-manager/base.nix @@ -0,0 +1,13 @@ +{ lib, hostname, ...}: +{ + programs.home-manager.enable = true; + home.sessionPath = [ + "$HOME/.local/bin" + ]; + imports = [ + ../hosts/${hostname}/home-config.nix + ../modules/home-manager/default.nix + ] ++ lib.optional ( + builtins.pathExists ../hosts/${hostname}/includes/home-manager.nix + ) ../hosts/${hostname}/includes/home-manager.nix; +} diff --git a/home-manager/default.nix b/home-manager/default.nix index 50f33fa..d04fa84 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,18 +1,11 @@ -{ lib, stateVersion, username, hostname, ... }: +{ stateVersion, username, ... }: { + home.stateVersion = stateVersion; home.username = "${username}"; home.homeDirectory = "/home/${username}"; - home.stateVersion = stateVersion; - programs.home-manager.enable = true; - fonts.fontconfig.enable = true; - home.sessionPath = [ - "$HOME/.local/bin" - ]; + fonts.fontconfig.enable = true; imports = [ + ./base.nix ../nixos/includes/system/overlay.nix - ../hosts/${hostname}/home-config.nix - ../modules/home-manager/default.nix - ]++ lib.optional ( - builtins.pathExists ../hosts/${hostname}/includes/home-manager.nix - ) ../hosts/${hostname}/includes/home-manager.nix; + ]; } diff --git a/nixos/default.nix b/nixos/default.nix index 4ff196f..983345b 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, lib, stateVersion, hostname, username, hostConfig, config, ... }: +{ inputs, pkgs, stateVersion, hostname, username, hostConfig, ... }: { imports = [ # Include the results of the hardware scan. ../hosts/${hostname}/hardware-configuration.nix @@ -51,18 +51,9 @@ users.${username} = { home.stateVersion = stateVersion; - programs.home-manager.enable = true; - - home.sessionPath = [ - "$HOME/.local/bin" - ]; - imports = [ - ../hosts/${hostname}/home-config.nix - ../modules/home-manager/default.nix - ] ++ lib.optional ( - builtins.pathExists ../hosts/${hostname}/includes/home-manager.nix - ) ../hosts/${hostname}/includes/home-manager.nix; + ../home-manager/base.nix + ]; }; };