WIP: flake: home-manager: export NixOS homes
All checks were successful
ci/woodpecker/push/check Pipeline was successful

WIP: this does not take into account the `profiles` which *also* setup
home-manager modules...

And here is what the last few commits were building up to.

This is neat, but won't be useful *very* often.
This commit is contained in:
Bruno BELANYI 2023-12-07 21:56:25 +00:00
parent 7bd06002de
commit 7ebfaa1de8

View file

@ -43,7 +43,12 @@ let
};
};
mkHome = name: mkHomeCommon "${self}/hosts/homes/${name}";
mkHome = name: mkHomeCommon [ "${self}/hosts/homes/${name}" ];
mkNixosHome = name: mkHomeCommon [
"${self}/hosts/nixos/${name}/home.nix"
"${self}/hosts/nixos/${name}/profiles.nix"
];
in
{
hosts.homes = {
@ -61,8 +66,18 @@ in
# Default configuration
ambroisie = system;
};
homeManagerHomes = lib.mapAttrs mkHome allHomes;
filteredNixosHosts = lib.filterAttrs (_: v: v == system) hosts.nixos;
nixosHomes' = lib.mapAttrs mkNixosHome filteredNixosHosts;
nixosHomeUsername = (host: self.nixosConfigurations.${host}.config.my.user.name);
nixosHomes = lib.mapAttrs' (host: lib.nameValuePair "${nixosHomeUsername host}@${host}") nixosHomes';
in
lib.mapAttrs mkHome allHomes;
lib.foldl' lib.mergeAttrs { }
[
homeManagerHomes
nixosHomes
];
};
};
}