mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
treewide: avoid passing pkgs
to our lib
In the two places where our "helpers" lib is exclusively internal (flake module args and building the docs), we no longer supply `pkgs`. In the other 4 locations, we now note why we still do in a comment.
This commit is contained in:
parent
76df09619d
commit
191b0a9502
7 changed files with 11 additions and 10 deletions
|
@ -7,7 +7,7 @@ let
|
||||||
# We overlay a few tweaks into pkgs, for use in the docs
|
# We overlay a few tweaks into pkgs, for use in the docs
|
||||||
pkgs = import ./pkgs.nix { inherit system nixpkgs; };
|
pkgs = import ./pkgs.nix { inherit system nixpkgs; };
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
helpers = import ../lib { inherit lib pkgs; };
|
helpers = import ../lib { inherit lib; };
|
||||||
|
|
||||||
nixvimPath = toString ./..;
|
nixvimPath = toString ./..;
|
||||||
|
|
||||||
|
@ -34,7 +34,9 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
evaledModules = lib.evalModules {
|
evaledModules = lib.evalModules {
|
||||||
inherit (helpers.modules) specialArgs;
|
specialArgs = helpers.modules.specialArgsWith {
|
||||||
|
defaultPkgs = pkgs;
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
../modules/top-level
|
../modules/top-level
|
||||||
{ isDocs = true; }
|
{ isDocs = true; }
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
{ helpers, ... }:
|
||||||
{
|
{
|
||||||
perSystem =
|
perSystem =
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
helpers,
|
|
||||||
makeNixvimWithModule,
|
makeNixvimWithModule,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
|
@ -5,11 +5,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
perSystem =
|
_module.args.helpers = import ../lib { inherit lib; };
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
_module.args.helpers = import ../lib { inherit lib pkgs; };
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: output lib without pkgs at the top-level
|
# TODO: output lib without pkgs at the top-level
|
||||||
flake.lib = lib.genAttrs config.systems (
|
flake.lib = lib.genAttrs config.systems (
|
||||||
|
@ -18,6 +14,7 @@
|
||||||
{
|
{
|
||||||
# NOTE: this is the publicly documented flake output we've had for a while
|
# NOTE: this is the publicly documented flake output we've had for a while
|
||||||
check = import ../lib/tests.nix { inherit lib pkgs; };
|
check = import ../lib/tests.nix { inherit lib pkgs; };
|
||||||
|
# NOTE: user-facing so we must include the legacy `pkgs` argument
|
||||||
helpers = import ../lib { inherit lib pkgs; };
|
helpers = import ../lib { inherit lib pkgs; };
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
{ self, ... }:
|
{ self, helpers, ... }:
|
||||||
{
|
{
|
||||||
perSystem =
|
perSystem =
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
pkgsUnfree,
|
pkgsUnfree,
|
||||||
system,
|
system,
|
||||||
helpers,
|
|
||||||
makeNixvimWithModule,
|
makeNixvimWithModule,
|
||||||
self',
|
self',
|
||||||
...
|
...
|
||||||
|
|
|
@ -45,6 +45,7 @@ let
|
||||||
}@args:
|
}@args:
|
||||||
let
|
let
|
||||||
helpers = import ../lib {
|
helpers = import ../lib {
|
||||||
|
# NOTE: must match the user-facing functions, so we still include the `pkgs` argument
|
||||||
inherit pkgs lib;
|
inherit pkgs lib;
|
||||||
# TODO: deprecate helpers.enableExceptInTests,
|
# TODO: deprecate helpers.enableExceptInTests,
|
||||||
# add a context option e.g. `config.isTest`?
|
# add a context option e.g. `config.isTest`?
|
||||||
|
|
|
@ -46,6 +46,7 @@ in
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
{
|
{
|
||||||
# Make our lib available to the host modules
|
# Make our lib available to the host modules
|
||||||
|
# NOTE: user-facing so we must include the legacy `pkgs` argument
|
||||||
lib.nixvim = lib.mkDefault (import ../lib { inherit pkgs lib; });
|
lib.nixvim = lib.mkDefault (import ../lib { inherit pkgs lib; });
|
||||||
|
|
||||||
# Make nixvim's "extended" lib available to the host's module args
|
# Make nixvim's "extended" lib available to the host's module args
|
||||||
|
|
|
@ -7,6 +7,7 @@ default_pkgs: self:
|
||||||
module,
|
module,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
# NOTE: user-facing so we must include the legacy `pkgs` argument
|
||||||
helpers = import ../lib { inherit pkgs lib _nixvimTests; };
|
helpers = import ../lib { inherit pkgs lib _nixvimTests; };
|
||||||
|
|
||||||
inherit (helpers.modules) evalNixvim;
|
inherit (helpers.modules) evalNixvim;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue