Skip to content

Instantly share code, notes, and snippets.

@adamcstephens
Created August 4, 2023 19:35
Show Gist options
  • Save adamcstephens/fae6c608aa4e3b4a75b67ed02e4319f4 to your computer and use it in GitHub Desktop.
Save adamcstephens/fae6c608aa4e3b4a75b67ed02e4319f4 to your computer and use it in GitHub Desktop.
nixos-remove-pkgs-eval-config
diff --git a/nixos/lib/eval-config.nix b/nixos/lib/eval-config.nix
index 81a5ea1750d..8346bb4a132 100644
--- a/nixos/lib/eval-config.nix
+++ b/nixos/lib/eval-config.nix
@@ -13,9 +13,6 @@ evalConfigArgs@
# however, removing or changing this default is too much
# of a breaking change. To set it modularly, pass `null`.
system ? builtins.currentSystem
-, # !!! is this argument needed any more? The pkgs argument can
- # be set modularly anyway.
- pkgs ? null
, # !!! what do we gain by making this configurable?
# we can add modules that are included in specialisations, regardless
# of inheritParentConfig.
@@ -34,9 +31,6 @@ evalConfigArgs@
in lib.optional (e != "") (import e)
}:
-let pkgs_ = pkgs;
-in
-
let
inherit (lib) optional;
@@ -57,16 +51,13 @@ let
# they way through, but has the last priority behind everything else.
nixpkgs.system = lib.mkDefault system;
})
- ++
- (optional (pkgs_ != null) {
- _module.args.pkgs = lib.mkForce pkgs_;
- })
);
};
withWarnings = x:
lib.warnIf (evalConfigArgs?extraArgs) "The extraArgs argument to eval-config.nix is deprecated. Please set config._module.args instead."
lib.warnIf (evalConfigArgs?check) "The check argument to eval-config.nix is deprecated. Please set config._module.check instead."
+ lib.warnIf (evalConfigArgs?pkgs) "The pkgs argument to eval-config.nix is deprecated. Please set config._module.pkgs instead."
x;
legacyModules =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment