configurations: use home-manager module by default

This commit is contained in:
Mateusz Słodkowicz 2024-03-21 23:01:42 +01:00
parent bc40af000f
commit cdc41c3934
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
9 changed files with 29 additions and 8 deletions

View File

@ -60,7 +60,6 @@
libGLU.dev libGLU.dev
vulkan-loader.dev vulkan-loader.dev
fpc
jdk jdk

View File

@ -3,7 +3,7 @@
let let
profiles = import ../profile; 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 let
nixosSystem = if stable then inputs.nixpkgs-stable.lib.nixosSystem else inputs.nixpkgs.lib.nixosSystem; 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; hm = if stable then inputs.configInputs-stable.home-manager else inputs.configInputs.home-manager;
@ -12,6 +12,7 @@ let
inherit materusFlake; inherit materusFlake;
inherit host; inherit host;
inherit hm; inherit hm;
inherit hmAsModule;
nixerus = if stable then inputs.configInputs-stable.nixerus else inputs.configInputs.nixerus; nixerus = if stable then inputs.configInputs-stable.nixerus else inputs.configInputs.nixerus;
configInputs = if stable then inputs.configInputs-stable else inputs.configInputs; configInputs = if stable then inputs.configInputs-stable else inputs.configInputs;
path = materusFlake.selfPath; path = materusFlake.selfPath;
@ -27,6 +28,27 @@ let
inputs.private.systemModule inputs.private.systemModule
profiles.osProfile profiles.osProfile
materusCfg.configInputs.sops-nix.nixosModules.sops 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; ] ++ extraModules;
}) // { inherit materusCfg; }; }) // { inherit materusCfg; };
in in
@ -34,7 +56,7 @@ in
materusPC = makeSystem { host = "materusPC"; stable = false; }; materusPC = makeSystem { host = "materusPC"; stable = false; };
flamaster = makeSystem { host = "flamaster"; stable = true; }; flamaster = makeSystem { host = "flamaster"; stable = true; };
valkyrie = makeSystem { host = "valkyrie"; 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; }; Old-materusPC = makeSystem { host = "Old-materusPC"; stable = false; };
} }

View File

@ -14,10 +14,10 @@ let
value = let host = builtins.elemAt hosts i; in value = let host = builtins.elemAt hosts i; in
materusFlake.nixosConfigurations.${host}.materusCfg.hm.lib.homeManagerConfiguration { materusFlake.nixosConfigurations.${host}.materusCfg.hm.lib.homeManagerConfiguration {
pkgs = materusFlake.nixosConfigurations.${host}.pkgs; 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 = [ modules = [
./${username} (materusFlake.selfPath + "/configurations/shared/home/${username}")
../host/${host}/extraHome.nix (materusFlake.selfPath + "/configurations/host/${host}/home/${username}")
profiles.homeProfile profiles.homeProfile
inputs.private.homeModule inputs.private.homeModule
materusFlake.nixosConfigurations.${host}.materusCfg.configInputs.sops-nix.homeManagerModules.sops materusFlake.nixosConfigurations.${host}.materusCfg.configInputs.sops-nix.homeManagerModules.sops
@ -36,10 +36,10 @@ let
inherit materusFlake; inherit materusFlake;
host = "Generic"; host = "Generic";
hm = inputs.configInputs.home-manager; hm = inputs.configInputs.home-manager;
hmAsModule = false;
nixerus = inputs.configInputs.nixerus; nixerus = inputs.configInputs.nixerus;
configInputs = inputs.configInputs; configInputs = inputs.configInputs;
path = materusFlake.selfPath; path = materusFlake.selfPath;
homePath = materusFlake.selfPath + "/configurations/home/${username}";
isHm = true; isHm = true;
}; };
in in

View File

@ -56,7 +56,7 @@
outputs = inputs @ { self, nixpkgs, home-manager, nur, ... }: outputs = inputs @ { self, nixpkgs, home-manager, nur, ... }:
rec { rec {
nixosConfigurations = import ./configurations/host { inherit inputs; materusFlake = self; }; 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; selfPath = self;
decrypted = builtins.pathExists (selfPath + "/decrypted"); decrypted = builtins.pathExists (selfPath + "/decrypted");
}; };