diff --git a/impure.nix b/impure.nix index 2d39bf1ae..929d4bf84 100644 --- a/impure.nix +++ b/impure.nix @@ -24,19 +24,20 @@ let pkgs.sops-nix.nixosModules.sops ]; mkFlavoredHost = args: let - host = evalHost args; + plainHost = evalHost args; # expose the toplevel nixos system as the toplevel attribute itself, # with nested aliases for other common build targets - in host.config.system.build.toplevel.overrideAttrs (base: { - passthru = (base.passthru or {}) // { - config = host.config; - fs = host.config.sane.fs; - img = host.config.system.build.img; - pkgs = host.config.system.build.pkgs; - programs = builtins.mapAttrs (_: p: p.package) host.config.sane.programs; - toplevel = host.config.system.build.toplevel; #< self - }; - }); + addPassthru = host: host.config.system.build.toplevel.overrideAttrs (base: { + passthru = (base.passthru or {}) // { + inherit (host) config; + inherit (host.config.sane) fs; + inherit (host.config.system.build) imgs pkgs; + programs = builtins.mapAttrs (_: p: p.package) host.config.sane.programs; + toplevel = host.config.system.build.toplevel; #< self + extendModules = arg: addPassthru (host.extendModules arg); + }; + }); + in addPassthru plainHost; mkHost = args: { # TODO: swap order: $host-{next,staging}-{min,light}: # then lexicographically-adjacent targets would also have the minimal difference in closure,