2023-10-08 11:42:08 +02:00
|
|
|
{ inputs, materusFlake, ... }:
|
|
|
|
let
|
|
|
|
profiles = import ../profile;
|
|
|
|
|
|
|
|
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-08 16:12:00 +02:00
|
|
|
inputs.configInputs.inputs.home-manager.lib.homeManagerConfiguration {
|
2023-10-08 11:42:08 +02:00
|
|
|
pkgs = materusFlake.nixosConfigurations.${host}.pkgs;
|
|
|
|
extraSpecialArgs = { inherit inputs; inherit materusFlake; };
|
|
|
|
modules = [
|
|
|
|
./${username}
|
|
|
|
../host/${host}/extraHome.nix
|
|
|
|
profiles.homeProfile
|
|
|
|
inputs.private.homeModule
|
|
|
|
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}]
|
|
|
|
++ (if ((i + 1) < len) then _for (i + 1) else [ ]))
|
|
|
|
);
|
|
|
|
in
|
|
|
|
(builtins.listToAttrs (_for 0)) // {
|
|
|
|
#Make generic x86_64-linux user profile "username"
|
2023-10-08 16:12:00 +02:00
|
|
|
${username} = inputs.configInputs.inputs.home-manager.lib.homeManagerConfiguration {
|
2023-10-08 11:42:08 +02:00
|
|
|
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; config = {allowUnfree = true;}; };
|
|
|
|
extraSpecialArgs = { inherit inputs; inherit materusFlake; };
|
|
|
|
modules = [
|
|
|
|
./${username}
|
|
|
|
profiles.homeProfile
|
|
|
|
inputs.private.homeModule
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
genHomes
|