diff --git a/nixos/lib/eval-config-minimal.nix b/nixos/lib/eval-config-minimal.nix index 6479b7144907..a0fcf2389779 100644 --- a/nixos/lib/eval-config-minimal.nix +++ b/nixos/lib/eval-config-minimal.nix @@ -4,7 +4,7 @@ let inherit (nonExtendedLib) warn; nonExtendedLib = import ../../lib; in -{ lib ? nonExtendedLib, ... }: +{ lib ? nonExtendedLib, bypassEvalModulesWarning ? false, ... }: let /* @@ -43,5 +43,5 @@ let in { - evalModules = builtins.seq experimentalWarning evalModules; + evalModules = builtins.seq (if bypassEvalModulesWarning then null else experimentalWarning) evalModules; } diff --git a/nixos/lib/eval-config.nix b/nixos/lib/eval-config.nix index 62d09b8173bd..8ea82b30f16d 100644 --- a/nixos/lib/eval-config.nix +++ b/nixos/lib/eval-config.nix @@ -33,6 +33,8 @@ let pkgs_ = pkgs; in let + evalModulesMinimal = (import ./eval-config-minimal.nix { inherit lib; bypassEvalModulesWarning = true; }).evalModules; + pkgsModule = rec { _file = ./eval-config.nix; key = _file; @@ -70,11 +72,9 @@ let }; allUserModules = modules ++ legacyModules; - noUserModules = lib.evalModules ({ - inherit prefix; + noUserModules = evalModulesMinimal ({ + inherit prefix specialArgs; modules = baseModules ++ extraModules ++ [ pkgsModule modulesModule ]; - specialArgs = - { modulesPath = builtins.toString ../modules; } // specialArgs; }); # Extra arguments that are useful for constructing a similar configuration.