2023-10-08 11:42:08 +02:00
|
|
|
{ inputs, materusFlake }:
|
|
|
|
|
|
|
|
let
|
|
|
|
profiles = import ../profile;
|
|
|
|
|
2024-03-21 23:01:42 +01:00
|
|
|
makeSystem = { host, arch ? "x86_64-linux", extraModules ? [ ], stable ? true, hmAsModule ? true, hmUsers ? [ "materus" ] }:
|
2023-10-27 17:00:26 +02:00
|
|
|
let
|
|
|
|
nixosSystem = if stable then inputs.nixpkgs-stable.lib.nixosSystem else inputs.nixpkgs.lib.nixosSystem;
|
2024-03-02 19:51:38 +01:00
|
|
|
hm = if stable then inputs.configInputs-stable.home-manager else inputs.configInputs.home-manager;
|
2024-02-25 22:21:11 +01:00
|
|
|
materusCfg = {
|
2023-10-27 17:00:26 +02:00
|
|
|
inherit stable;
|
|
|
|
inherit materusFlake;
|
|
|
|
inherit host;
|
|
|
|
inherit hm;
|
2024-03-21 23:01:42 +01:00
|
|
|
inherit hmAsModule;
|
2024-10-15 21:22:16 +02:00
|
|
|
inherit arch;
|
2024-03-02 19:51:38 +01:00
|
|
|
nixerus = if stable then inputs.configInputs-stable.nixerus else inputs.configInputs.nixerus;
|
2023-10-27 17:00:26 +02:00
|
|
|
configInputs = if stable then inputs.configInputs-stable else inputs.configInputs;
|
|
|
|
path = materusFlake.selfPath;
|
2024-03-03 02:50:46 +01:00
|
|
|
hostPath = materusFlake.selfPath + "/configurations/host/${host}";
|
2024-02-25 22:30:13 +01:00
|
|
|
isHm = false;
|
2023-10-27 17:00:26 +02:00
|
|
|
};
|
|
|
|
in
|
2024-02-25 22:30:13 +01:00
|
|
|
(nixosSystem {
|
2023-10-27 17:00:26 +02:00
|
|
|
specialArgs = { inherit materusCfg; };
|
|
|
|
system = arch;
|
|
|
|
modules = [
|
|
|
|
./${host}
|
|
|
|
profiles.osProfile
|
2024-03-02 22:36:43 +01:00
|
|
|
materusCfg.configInputs.sops-nix.nixosModules.sops
|
2024-03-21 23:01:42 +01:00
|
|
|
(if hmAsModule then hm.nixosModules.home-manager else { })
|
|
|
|
(if hmAsModule then
|
|
|
|
{
|
2024-11-01 00:10:11 +01:00
|
|
|
home-manager.backupFileExtension = "hm-backup";
|
2024-03-21 23:01:42 +01:00
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
2024-10-23 11:35:54 +02:00
|
|
|
home-manager.sharedModules = [
|
|
|
|
materusCfg.configInputs.plasma-manager.homeManagerModules.plasma-manager
|
|
|
|
materusCfg.configInputs.sops-nix.homeManagerModules.sops
|
|
|
|
];
|
2024-03-21 23:01:42 +01:00
|
|
|
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 { })
|
|
|
|
|
2023-10-27 17:00:26 +02:00
|
|
|
] ++ extraModules;
|
|
|
|
}) // { inherit materusCfg; };
|
2023-10-27 14:01:54 +02:00
|
|
|
in
|
|
|
|
{
|
2024-06-17 13:09:58 +02:00
|
|
|
materusPC = makeSystem { host = "materusPC"; stable = true; };
|
2023-10-27 17:00:26 +02:00
|
|
|
flamaster = makeSystem { host = "flamaster"; stable = true; };
|
|
|
|
valkyrie = makeSystem { host = "valkyrie"; stable = true; };
|
2024-03-21 23:01:42 +01:00
|
|
|
waffentrager = makeSystem { host = "waffentrager"; stable = true; arch = "aarch64-linux"; };
|
2023-11-03 16:06:37 +01:00
|
|
|
|
2024-06-17 13:09:58 +02:00
|
|
|
Old-materusPC = makeSystem { host = "Old-materusPC"; stable = true; };
|
2023-10-08 11:42:08 +02:00
|
|
|
}
|