diff --git a/flake.nix b/flake.nix index edc96e10..cbf1f890 100644 --- a/flake.nix +++ b/flake.nix @@ -82,7 +82,6 @@ imports = [ ./hosts - ./home ./pre-commit-hooks.nix ]; diff --git a/home/default.nix b/home/default.nix index 538b87fe..a505cc02 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,23 +1,9 @@ -{ self, inputs, ... }: { - flake.homeConfigurations = - let - inherit (inputs.hm.lib) homeManagerConfiguration; + grovetender = [ + ./profiles/grovetender.nix + ]; - extraSpecialArgs = { - inherit inputs self; - }; - pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; - - mkHome = - user: hostname: - homeManagerConfiguration { - inherit extraSpecialArgs pkgs; - modules = [ ./${user}/${hostname}.nix ]; - }; - in - { - "gwen@grovetender" = mkHome "gwen" "grovetender"; - "gwen@aurelionite" = mkHome "gwen" "aurelionite"; - }; + aurelionite = [ + ./profiles/aurelionite.nix + ]; } diff --git a/home/gwen/aurelionite.nix b/home/profiles/aurelionite.nix similarity index 100% rename from home/gwen/aurelionite.nix rename to home/profiles/aurelionite.nix diff --git a/home/gwen/grovetender.nix b/home/profiles/grovetender.nix similarity index 100% rename from home/gwen/grovetender.nix rename to home/profiles/grovetender.nix diff --git a/hosts/default.nix b/hosts/default.nix index 8ae8b32d..2c1da290 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,24 +1,43 @@ -{ self, inputs, ... }: +{ + self, + lib, + inputs, + ... +}: { flake.nixosConfigurations = let inherit (inputs.nixpkgs.lib) nixosSystem; inherit (import "${self}/modules/nixos") default; + homeImports = import "${self}/home/profiles"; + specialArgs = { inherit inputs self; }; mkHost = - hostname: + { + hostname, + user ? "", + }: nixosSystem { inherit specialArgs; - modules = default ++ [ ./${hostname} ]; + modules = default ++ [ + ./${hostname} + (lib.mkIf user == "") + { + home-manager = { + users.${user}.imports = homeImports.${hostname}; + extraSpecialArgs = specialArgs; + }; + } + ]; }; in { - grovetender = mkHost "grovetender"; - aurelionite = mkHost "aurelionite"; + grovetender = mkHost "grovetender" "gwen"; + aurelionite = mkHost "aurelionite" "gwen"; mithrix = mkHost "mithrix"; }; } diff --git a/modules/home/core/default.nix b/modules/home/core/default.nix index 4cdd2fc3..a295dc07 100644 --- a/modules/home/core/default.nix +++ b/modules/home/core/default.nix @@ -1,6 +1,6 @@ -{ config, ... }: +{ config, self, ... }: { - wallpaper = /etc/nixos/home/shared/walls/${config.theme}.jpg; + wallpaper = "${self}/home/shared/walls/${config.theme}.jpg"; home.sessionVariables.EDITOR = "nvim"; imports = [ ./gtk.nix