Skip to content

Commit 49a7bb5

Browse files
committed
modules/top-level: change usages of import to callPackage
1 parent 4c23fb2 commit 49a7bb5

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

modules/top-level/output.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ in
172172
config =
173173
let
174174
# Optionally byte compile lua library
175-
inherit (import ./plugins/byte-compile-lua-lib.nix { inherit lib pkgs; }) byteCompileLuaPackages;
175+
inherit (pkgs.callPackage ./plugins/byte-compile-lua-lib.nix { inherit lib; })
176+
byteCompileLuaPackages
177+
;
176178
extraLuaPackages =
177179
if config.performance.byteCompileLua.enable && config.performance.byteCompileLua.luaLib then
178180
ps: byteCompileLuaPackages (config.extraLuaPackages ps)

modules/top-level/plugins/byte-compile-lua-lib.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Utilities for byte compiling of lua dependencies
2-
{ lib, pkgs }:
2+
{
3+
lib,
4+
pkgs,
5+
neovim-unwrapped,
6+
}:
37
let
48
builders = lib.nixvim.builders.withPkgs pkgs;
59
inherit (import ./utils.nix lib) mapNormalizedPlugins;
610

7-
luaPackages = pkgs.neovim-unwrapped.lua.pkgs;
11+
luaPackages = neovim-unwrapped.lua.pkgs;
812

913
# Applies a function to the derivation, but only if it's a lua module,
1014
# otherwise returns it as is

modules/top-level/plugins/combine-plugins.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
lib,
3-
pkgs,
3+
callPackage,
44
pathsToLink,
55
standalonePlugins,
66
}:
@@ -9,7 +9,7 @@ let
99
getAndNormalizeDeps
1010
removeDeps
1111
;
12-
mkPluginPack = import ./mk-plugin-pack.nix { inherit lib pkgs; };
12+
mkPluginPack = callPackage ./mk-plugin-pack.nix { inherit lib; };
1313

1414
in
1515
/*

modules/top-level/plugins/default.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ in
3232
build.plugins =
3333
let
3434
shouldCompilePlugins = byteCompileCfg.enable && byteCompileCfg.plugins;
35-
byteCompilePlugins = import ./byte-compile-plugins.nix { inherit lib pkgs; };
35+
byteCompilePlugins = pkgs.callPackage ./byte-compile-plugins.nix { inherit lib; };
3636

3737
shouldCompileLuaLib = byteCompileCfg.enable && byteCompileCfg.luaLib;
38-
inherit (import ./byte-compile-lua-lib.nix { inherit lib pkgs; }) byteCompilePluginDeps;
38+
inherit (pkgs.callPackage ./byte-compile-lua-lib.nix { inherit lib; }) byteCompilePluginDeps;
3939

4040
shouldCombinePlugins = config.performance.combinePlugins.enable;
41-
combinePlugins = import ./combine-plugins.nix {
42-
inherit lib pkgs;
41+
combinePlugins = pkgs.callPackage ./combine-plugins.nix {
42+
inherit lib;
4343
inherit (config.performance.combinePlugins)
4444
standalonePlugins
4545
pathsToLink

modules/top-level/plugins/mk-plugin-pack.nix

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{ lib, pkgs }:
1+
{
2+
lib,
3+
buildEnv,
4+
vimUtils,
5+
}:
26
let
37
inherit (import ./utils.nix lib) normalizePlugin;
48
in
@@ -8,7 +12,7 @@ let
812
overridePlugin =
913
plugin:
1014
plugin.plugin.overrideAttrs (prev: {
11-
nativeBuildInputs = lib.remove pkgs.vimUtils.vimGenDocHook prev.nativeBuildInputs or [ ];
15+
nativeBuildInputs = lib.remove vimUtils.vimGenDocHook prev.nativeBuildInputs or [ ];
1216
configurePhase = ''
1317
${prev.configurePhase or ""}
1418
rm -vf doc/tags'';
@@ -56,8 +60,8 @@ let
5660
};
5761
}
5862
[
59-
pkgs.buildEnv
60-
pkgs.vimUtils.toVimPlugin
63+
buildEnv
64+
vimUtils.toVimPlugin
6165
(drv: drv.overrideAttrs { inherit propagatedBuildInputs; })
6266
];
6367

0 commit comments

Comments
 (0)