modules/top-level: change usages of import to callPackage

This commit is contained in:
Stanislav Asunkin 2025-05-12 17:21:02 +03:00
parent 4c23fb2738
commit 49a7bb573a
5 changed files with 23 additions and 13 deletions

View file

@ -172,7 +172,9 @@ in
config =
let
# Optionally byte compile lua library
inherit (import ./plugins/byte-compile-lua-lib.nix { inherit lib pkgs; }) byteCompileLuaPackages;
inherit (pkgs.callPackage ./plugins/byte-compile-lua-lib.nix { inherit lib; })
byteCompileLuaPackages
;
extraLuaPackages =
if config.performance.byteCompileLua.enable && config.performance.byteCompileLua.luaLib then
ps: byteCompileLuaPackages (config.extraLuaPackages ps)

View file

@ -1,10 +1,14 @@
# Utilities for byte compiling of lua dependencies
{ lib, pkgs }:
{
lib,
pkgs,
neovim-unwrapped,
}:
let
builders = lib.nixvim.builders.withPkgs pkgs;
inherit (import ./utils.nix lib) mapNormalizedPlugins;
luaPackages = pkgs.neovim-unwrapped.lua.pkgs;
luaPackages = neovim-unwrapped.lua.pkgs;
# Applies a function to the derivation, but only if it's a lua module,
# otherwise returns it as is

View file

@ -1,6 +1,6 @@
{
lib,
pkgs,
callPackage,
pathsToLink,
standalonePlugins,
}:
@ -9,7 +9,7 @@ let
getAndNormalizeDeps
removeDeps
;
mkPluginPack = import ./mk-plugin-pack.nix { inherit lib pkgs; };
mkPluginPack = callPackage ./mk-plugin-pack.nix { inherit lib; };
in
/*

View file

@ -32,14 +32,14 @@ in
build.plugins =
let
shouldCompilePlugins = byteCompileCfg.enable && byteCompileCfg.plugins;
byteCompilePlugins = import ./byte-compile-plugins.nix { inherit lib pkgs; };
byteCompilePlugins = pkgs.callPackage ./byte-compile-plugins.nix { inherit lib; };
shouldCompileLuaLib = byteCompileCfg.enable && byteCompileCfg.luaLib;
inherit (import ./byte-compile-lua-lib.nix { inherit lib pkgs; }) byteCompilePluginDeps;
inherit (pkgs.callPackage ./byte-compile-lua-lib.nix { inherit lib; }) byteCompilePluginDeps;
shouldCombinePlugins = config.performance.combinePlugins.enable;
combinePlugins = import ./combine-plugins.nix {
inherit lib pkgs;
combinePlugins = pkgs.callPackage ./combine-plugins.nix {
inherit lib;
inherit (config.performance.combinePlugins)
standalonePlugins
pathsToLink

View file

@ -1,4 +1,8 @@
{ lib, pkgs }:
{
lib,
buildEnv,
vimUtils,
}:
let
inherit (import ./utils.nix lib) normalizePlugin;
in
@ -8,7 +12,7 @@ let
overridePlugin =
plugin:
plugin.plugin.overrideAttrs (prev: {
nativeBuildInputs = lib.remove pkgs.vimUtils.vimGenDocHook prev.nativeBuildInputs or [ ];
nativeBuildInputs = lib.remove vimUtils.vimGenDocHook prev.nativeBuildInputs or [ ];
configurePhase = ''
${prev.configurePhase or ""}
rm -vf doc/tags'';
@ -56,8 +60,8 @@ let
};
}
[
pkgs.buildEnv
pkgs.vimUtils.toVimPlugin
buildEnv
vimUtils.toVimPlugin
(drv: drv.overrideAttrs { inherit propagatedBuildInputs; })
];