From f7e91dc1b969dc14aaaf28dc2680c99daa8389ab Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 7 Dec 2023 21:56:25 +0000 Subject: [PATCH] WIP: flake: home-manager: export NixOS homes 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. --- flake/home-manager.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/flake/home-manager.nix b/flake/home-manager.nix index 5a1fa87..2e385c6 100644 --- a/flake/home-manager.nix +++ b/flake/home-manager.nix @@ -40,6 +40,8 @@ let }; mkHome = name: mkHomeCommon "${self}/hosts/homes/${name}"; + + mkNixosHome = name: mkHomeCommon "${self}/hosts/nixos/${name}/home.nix"; in { hosts.homes = { @@ -57,8 +59,17 @@ in # Default configuration ambroisie = system; }; + homeManagerHomes = lib.mapAttrs mkHome allHomes; + + filteredNixosHosts = lib.filterAttrs (_: v: v == system) hosts.nixos; + nixosHomes' = lib.mapAttrs mkNixosHome filteredNixosHosts; + nixosHomes = lib.mapAttrs' (host: lib.nameValuePair "ambroisie@${host}") nixosHomes'; in - lib.mapAttrs mkHome allHomes; + lib.foldl' lib.mergeAttrs { } + [ + homeManagerHomes + nixosHomes + ]; }; }; }