diff --git a/nixos/lib/eval-config.nix b/nixos/lib/eval-config.nix index e1242276a74d..81a5ea1750de 100644 --- a/nixos/lib/eval-config.nix +++ b/nixos/lib/eval-config.nix @@ -109,8 +109,10 @@ let nixosWithUserModules = noUserModules.extendModules { modules = allUserModules; }; + withExtraArgs = nixosSystem: nixosSystem // { + inherit extraArgs; + inherit (nixosSystem._module.args) pkgs; + extendModules = args: withExtraArgs (nixosSystem.extendModules args); + }; in -withWarnings nixosWithUserModules // { - inherit extraArgs; - inherit (nixosWithUserModules._module.args) pkgs; -} +withWarnings (withExtraArgs nixosWithUserModules)