mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
modules/nixpkgs: don't set args.lib
`lib.evalModules` always includes `lib`, `config`, `options`, &
(configured) `specialArgs` in the (final) `specialArgs`[1].
Therefore, setting `_module.args.lib` has no effect.
[1]: 329d232802/lib/modules.nix (L233)
This commit is contained in:
parent
11df0d6c9e
commit
87f50db84d
1 changed files with 8 additions and 16 deletions
|
@ -1,24 +1,16 @@
|
||||||
{
|
{ defaultPkgs, lib, ... }:
|
||||||
defaultPkgs,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
# TODO: https://github.com/nix-community/nixvim/issues/1784
|
# TODO: https://github.com/nix-community/nixvim/issues/1784
|
||||||
finalPackage = defaultPkgs;
|
finalPackage = defaultPkgs;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
_module.args = {
|
# We explicitly set the default override priority, so that we do not need
|
||||||
# We explicitly set the default override priority, so that we do not need
|
# to evaluate finalPkgs in case an override is placed on `_module.args.pkgs`.
|
||||||
# to evaluate finalPkgs in case an override is placed on `_module.args.pkgs`.
|
# After all, to determine a definition priority, we need to evaluate `._type`,
|
||||||
# After all, to determine a definition priority, we need to evaluate `._type`,
|
# which is somewhat costly for Nixpkgs. With an explicit priority, we only
|
||||||
# which is somewhat costly for Nixpkgs. With an explicit priority, we only
|
# evaluate the wrapper to find out that the priority is lower, and then we
|
||||||
# evaluate the wrapper to find out that the priority is lower, and then we
|
# don't need to evaluate `finalPkgs`.
|
||||||
# don't need to evaluate `finalPkgs`.
|
_module.args.pkgs = lib.mkOverride lib.modules.defaultOverridePriority finalPackage;
|
||||||
pkgs = lib.mkOverride lib.modules.defaultOverridePriority finalPackage;
|
|
||||||
inherit (pkgs) lib;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue