flake: home-manager: export NixOS homes
All checks were successful
ci/woodpecker/push/check Pipeline was successful
All checks were successful
ci/woodpecker/push/check Pipeline was successful
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:
parent
c593180cf2
commit
0fb2ed977e
|
@ -44,6 +44,11 @@ let
|
|||
};
|
||||
|
||||
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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue