2023-10-08 11:42:08 +02:00
|
|
|
{ inputs, materusFlake, ... }:
|
|
|
|
let
|
2024-03-30 15:34:52 +01:00
|
|
|
profiles = import (materusFlake.selfPath + "/configurations/profile");
|
2023-10-08 11:42:08 +02:00
|
|
|
|
|
|
|
hosts = builtins.attrNames materusFlake.nixosConfigurations;
|
|
|
|
genHomes = username:
|
|
|
|
let
|
|
|
|
#Make host specific user profile "username@host"
|
|
|
|
_list = builtins.map (host: username + "@" + host) hosts;
|
|
|
|
_for = i: (
|
|
|
|
let len = builtins.length hosts; in
|
|
|
|
([{
|
|
|
|
name = builtins.elemAt _list i;
|
|
|
|
value = let host = builtins.elemAt hosts i; in
|
2023-10-27 14:01:54 +02:00
|
|
|
materusFlake.nixosConfigurations.${host}.materusCfg.hm.lib.homeManagerConfiguration {
|
2023-10-08 11:42:08 +02:00
|
|
|
pkgs = materusFlake.nixosConfigurations.${host}.pkgs;
|
2024-03-21 23:01:42 +01:00
|
|
|
extraSpecialArgs = { materusCfg = materusFlake.nixosConfigurations.${host}.materusCfg // { isHm = true; }; };
|
2023-10-08 11:42:08 +02:00
|
|
|
modules = [
|
2024-03-21 23:01:42 +01:00
|
|
|
(materusFlake.selfPath + "/configurations/shared/home/${username}")
|
|
|
|
(materusFlake.selfPath + "/configurations/host/${host}/home/${username}")
|
2023-10-08 11:42:08 +02:00
|
|
|
profiles.homeProfile
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}]
|
|
|
|
++ (if ((i + 1) < len) then _for (i + 1) else [ ]))
|
|
|
|
);
|
|
|
|
in
|
|
|
|
(builtins.listToAttrs (_for 0)) // {
|
|
|
|
#Make generic x86_64-linux user profile "username"
|
2023-10-27 17:00:26 +02:00
|
|
|
${username} =
|
2024-03-11 16:19:31 +01:00
|
|
|
let
|
|
|
|
materusCfg = {
|
|
|
|
stable = false;
|
|
|
|
inherit materusFlake;
|
|
|
|
host = "Generic";
|
|
|
|
hm = inputs.configInputs.home-manager;
|
2024-03-21 23:01:42 +01:00
|
|
|
hmAsModule = false;
|
2024-03-11 16:19:31 +01:00
|
|
|
nixerus = inputs.configInputs.nixerus;
|
|
|
|
configInputs = inputs.configInputs;
|
|
|
|
path = materusFlake.selfPath;
|
|
|
|
isHm = true;
|
|
|
|
};
|
|
|
|
in
|
2024-03-02 19:51:38 +01:00
|
|
|
inputs.configInputs.home-manager.lib.homeManagerConfiguration {
|
2023-10-27 17:00:26 +02:00
|
|
|
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; config = { allowUnfree = true; }; };
|
|
|
|
extraSpecialArgs = { inherit materusCfg; };
|
|
|
|
modules = [
|
|
|
|
./${username}
|
|
|
|
profiles.homeProfile
|
2024-03-02 22:36:43 +01:00
|
|
|
materusCfg.configInputs.sops-nix.homeManagerModules.sops
|
2024-10-23 11:07:05 +02:00
|
|
|
materusCfg.configInputs.plasma-manager.homeManagerModules.plasma-manager
|
2023-10-27 17:00:26 +02:00
|
|
|
];
|
|
|
|
};
|
2023-10-08 11:42:08 +02:00
|
|
|
};
|
|
|
|
in
|
|
|
|
genHomes
|