From 0c9d9c59197649a8bc08d283d27f07973b4ea092 Mon Sep 17 00:00:00 2001 From: anntnzrb Date: Thu, 5 Mar 2026 14:24:24 -0500 Subject: [PATCH] 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. --- snowfall-lib/flake/default.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/snowfall-lib/flake/default.nix b/snowfall-lib/flake/default.nix index 6d2b9f8..8c84668 100644 --- a/snowfall-lib/flake/default.nix +++ b/snowfall-lib/flake/default.nix @@ -208,8 +208,34 @@ let 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 // { inherit overlays; + homeConfigurations = home-configurations; }; in flake-outputs