fix(home): resolve hosted home config args

Hosted homes were being exported through homeConfigurations and package activation outputs without rebinding osConfig and systemConfig to their parent system config. Resolve hosted homes against their matching system before exposing those outputs so user@host homes no longer evaluate with null specialArgs.
This commit is contained in:
anntnzrb
2026-03-05 14:24:24 -05:00
committed by mjallen18
parent 8128bbb92f
commit 0c9d9c5919

View File

@@ -208,8 +208,34 @@ let
flake-utils-plus-outputs = core-inputs.flake-utils-plus.lib.mkFlake flake-options; flake-utils-plus-outputs = core-inputs.flake-utils-plus.lib.mkFlake flake-options;
resolve-hosted-home =
home-name: home:
let
host = home.specialArgs.host or "";
has-hosted-system = host != "" && systems ? ${host};
in
if has-hosted-system then
let
system-output = systems.${host}.output;
host-config = flake-utils-plus-outputs.${system-output}.${host}.config;
in
home.builder {
inherit (home) modules;
specialArgs = home.specialArgs // {
osConfig = host-config;
systemConfig = host-config;
};
}
else
flake-utils-plus-outputs.homeConfigurations.${home-name};
# Hosted homes need their parent system config injected before standalone
# homeConfigurations or activation packages are forced.
home-configurations = mapAttrs resolve-hosted-home homes;
flake-outputs = flake-utils-plus-outputs // { flake-outputs = flake-utils-plus-outputs // {
inherit overlays; inherit overlays;
homeConfigurations = home-configurations;
}; };
in in
flake-outputs flake-outputs