mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +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
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
# The nixvim flake
|
||||
self,
|
||||
# Extra args for the `evalNixvim` call that produces the type for `programs.nixvim`
|
||||
evalArgs ? { },
|
||||
# Option path where extraFiles should go
|
||||
|
@ -57,7 +59,13 @@ in
|
|||
config = mkMerge [
|
||||
{
|
||||
# Make our lib available to the host modules
|
||||
lib.nixvim = lib.mkDefault (import ../lib { inherit lib; });
|
||||
# NOTE: user-facing so we must include the legacy `pkgs` argument
|
||||
lib.nixvim = lib.mkDefault (
|
||||
import ../lib {
|
||||
inherit lib;
|
||||
flake = self;
|
||||
}
|
||||
);
|
||||
|
||||
# Make nixvim's "extended" lib available to the host's module args
|
||||
_module.args.nixvimLib = lib.mkDefault config.lib.nixvim.extendedLib;
|
||||
|
|
|
@ -22,7 +22,7 @@ in
|
|||
{
|
||||
_file = ./darwin.nix;
|
||||
|
||||
imports = [ (import ./_shared.nix { inherit evalArgs; }) ];
|
||||
imports = [ (import ./_shared.nix { inherit self evalArgs; }) ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
|
|
|
@ -24,7 +24,7 @@ in
|
|||
|
||||
imports = [
|
||||
(import ./_shared.nix {
|
||||
inherit evalArgs;
|
||||
inherit self evalArgs;
|
||||
filesOpt = [
|
||||
"xdg"
|
||||
"configFile"
|
||||
|
|
|
@ -24,7 +24,7 @@ in
|
|||
|
||||
imports = [
|
||||
(import ./_shared.nix {
|
||||
inherit evalArgs;
|
||||
inherit self evalArgs;
|
||||
filesOpt = [
|
||||
"environment"
|
||||
"etc"
|
||||
|
|
|
@ -9,7 +9,11 @@ default_pkgs: self:
|
|||
}:
|
||||
let
|
||||
# NOTE: we are importing this just for evalNixvim
|
||||
helpers = import ../lib { inherit lib _nixvimTests; };
|
||||
helpers = import ../lib {
|
||||
inherit lib _nixvimTests;
|
||||
flake = self;
|
||||
};
|
||||
|
||||
inherit (helpers.modules) evalNixvim;
|
||||
|
||||
mkNvim =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue