diff --git a/configurations/host/Old-materusPC/extraHome.nix b/configurations/host/Old-materusPC/home/materus/default.nix similarity index 99% rename from configurations/host/Old-materusPC/extraHome.nix rename to configurations/host/Old-materusPC/home/materus/default.nix index ec27c79..6241ad9 100644 --- a/configurations/host/Old-materusPC/extraHome.nix +++ b/configurations/host/Old-materusPC/home/materus/default.nix @@ -60,7 +60,6 @@ libGLU.dev vulkan-loader.dev - fpc jdk diff --git a/configurations/host/default.nix b/configurations/host/default.nix index aaea0b4..64b2f83 100644 --- a/configurations/host/default.nix +++ b/configurations/host/default.nix @@ -3,7 +3,7 @@ let profiles = import ../profile; - makeSystem = { host, arch ? "x86_64-linux", extraModules ? [ ], stable ? true }: + makeSystem = { host, arch ? "x86_64-linux", extraModules ? [ ], stable ? true, hmAsModule ? true, hmUsers ? [ "materus" ] }: let nixosSystem = if stable then inputs.nixpkgs-stable.lib.nixosSystem else inputs.nixpkgs.lib.nixosSystem; hm = if stable then inputs.configInputs-stable.home-manager else inputs.configInputs.home-manager; @@ -12,6 +12,7 @@ let inherit materusFlake; inherit host; inherit hm; + inherit hmAsModule; nixerus = if stable then inputs.configInputs-stable.nixerus else inputs.configInputs.nixerus; configInputs = if stable then inputs.configInputs-stable else inputs.configInputs; path = materusFlake.selfPath; @@ -27,6 +28,27 @@ let inputs.private.systemModule profiles.osProfile materusCfg.configInputs.sops-nix.nixosModules.sops + (if hmAsModule then hm.nixosModules.home-manager else { }) + (if hmAsModule then + { + + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users = (builtins.foldl' (a: b: a // b) { } (builtins.map + (user: { + ${user} = ({ ... }: + { + imports = [ + (materusFlake.selfPath + "/configurations/shared/home/${user}") + (materusFlake.selfPath + "/configurations/host/${host}/home/${user}") + profiles.homeProfile + ]; + }); + }) + hmUsers)); + home-manager.extraSpecialArgs = { materusCfg = materusCfg // { isHm = true; }; }; + } else { }) + ] ++ extraModules; }) // { inherit materusCfg; }; in @@ -34,7 +56,7 @@ in materusPC = makeSystem { host = "materusPC"; stable = false; }; flamaster = makeSystem { host = "flamaster"; stable = true; }; valkyrie = makeSystem { host = "valkyrie"; stable = true; }; - waffentrager = makeSystem { host = "waffentrager"; stable = false; arch = "aarch64-linux"; extraModules = [ ]; }; + waffentrager = makeSystem { host = "waffentrager"; stable = true; arch = "aarch64-linux"; }; Old-materusPC = makeSystem { host = "Old-materusPC"; stable = false; }; } diff --git a/configurations/host/flamaster/extraHome.nix b/configurations/host/flamaster/home/materus/default.nix similarity index 100% rename from configurations/host/flamaster/extraHome.nix rename to configurations/host/flamaster/home/materus/default.nix diff --git a/configurations/host/materusPC/extraHome.nix b/configurations/host/materusPC/home/materus/default.nix similarity index 100% rename from configurations/host/materusPC/extraHome.nix rename to configurations/host/materusPC/home/materus/default.nix diff --git a/configurations/host/waffentrager/extraHome.nix b/configurations/host/waffentrager/home/materus/default.nix similarity index 100% rename from configurations/host/waffentrager/extraHome.nix rename to configurations/host/waffentrager/home/materus/default.nix diff --git a/configurations/home/default.nix b/configurations/shared/home/default.nix similarity index 100% rename from configurations/home/default.nix rename to configurations/shared/home/default.nix diff --git a/configurations/home/genHomes.nix b/configurations/shared/home/genHomes.nix similarity index 87% rename from configurations/home/genHomes.nix rename to configurations/shared/home/genHomes.nix index 6288432..3ecbee2 100644 --- a/configurations/home/genHomes.nix +++ b/configurations/shared/home/genHomes.nix @@ -14,10 +14,10 @@ let value = let host = builtins.elemAt hosts i; in materusFlake.nixosConfigurations.${host}.materusCfg.hm.lib.homeManagerConfiguration { pkgs = materusFlake.nixosConfigurations.${host}.pkgs; - extraSpecialArgs = { materusCfg = materusFlake.nixosConfigurations.${host}.materusCfg // { homePath = materusFlake.selfPath + "/configurations/home/${username}"; isHm = true; }; }; + extraSpecialArgs = { materusCfg = materusFlake.nixosConfigurations.${host}.materusCfg // { isHm = true; }; }; modules = [ - ./${username} - ../host/${host}/extraHome.nix + (materusFlake.selfPath + "/configurations/shared/home/${username}") + (materusFlake.selfPath + "/configurations/host/${host}/home/${username}") profiles.homeProfile inputs.private.homeModule materusFlake.nixosConfigurations.${host}.materusCfg.configInputs.sops-nix.homeManagerModules.sops @@ -36,10 +36,10 @@ let inherit materusFlake; host = "Generic"; hm = inputs.configInputs.home-manager; + hmAsModule = false; nixerus = inputs.configInputs.nixerus; configInputs = inputs.configInputs; path = materusFlake.selfPath; - homePath = materusFlake.selfPath + "/configurations/home/${username}"; isHm = true; }; in diff --git a/configurations/home/materus/default.nix b/configurations/shared/home/materus/default.nix similarity index 100% rename from configurations/home/materus/default.nix rename to configurations/shared/home/materus/default.nix diff --git a/flake.nix b/flake.nix index 09f679f..1aeda39 100644 --- a/flake.nix +++ b/flake.nix @@ -56,7 +56,7 @@ outputs = inputs @ { self, nixpkgs, home-manager, nur, ... }: rec { nixosConfigurations = import ./configurations/host { inherit inputs; materusFlake = self; }; - homeConfigurations = import ./configurations/home { inherit inputs; materusFlake = self; }; + homeConfigurations = import ./configurations/shared/home { inherit inputs; materusFlake = self; }; selfPath = self; decrypted = builtins.pathExists (selfPath + "/decrypted"); };