mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-22 03:35:21 +02:00
lib/modules: pass inputs.nixpkgs
into evalNixvim
Expose our locked nixpkgs as the `nixpkgs.source` module options. This only happens when `evalNixvim` is part of a lib that was provided `flake` as an argument. Stubbed the `nixpkgs.source` option for now. Eventually, this will be used to construct `pkgs` internally. For now, it's purely informational.
This commit is contained in:
parent
e16d244865
commit
bef9feb446
11 changed files with 62 additions and 11 deletions
|
@ -125,6 +125,21 @@ in
|
|||
-->
|
||||
'';
|
||||
};
|
||||
|
||||
# NOTE: This is a nixvim-specific option; there's no equivalent in nixos
|
||||
source = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
# NOTE: default is only set if `flake` is passed to our lib
|
||||
defaultText = lib.literalMD "Nixvim's flake `input.nixpkgs`";
|
||||
description = ''
|
||||
The path to import Nixpkgs from.
|
||||
|
||||
Ignored when `nixpkgs.pkgs` is set.
|
||||
'';
|
||||
|
||||
# FIXME: This is a stub option for now
|
||||
internal = true;
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
|
@ -150,5 +165,10 @@ in
|
|||
# evaluate the wrapper to find out that the priority is lower, and then we
|
||||
# don't need to evaluate `finalPkgs`.
|
||||
_module.args.pkgs = lib.mkOverride lib.modules.defaultOverridePriority finalPkgs.__splicedPackages;
|
||||
|
||||
# FIXME: This is a stub option for now
|
||||
warnings = lib.optional (
|
||||
opt.source.isDefined && opt.source.highestPrio < (lib.mkOptionDefault null).priority
|
||||
) "Defining the option `nixpkgs.source` currently has no effect";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue