mirror of
https://github.com/mjallen18/snowfall-lib.git
synced 2026-04-18 09:05:58 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user