From 78c01d50ed66d64ad05a093d6ce593775c101435 Mon Sep 17 00:00:00 2001 From: diniamo Date: Sat, 10 Aug 2024 09:05:06 +0200 Subject: [PATCH] fix: use luajit from the neovim package's lua attribute --- modules/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index b466d2e..2bd72d7 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -29,6 +29,8 @@ inputs: { # alias to the internal configuration vimOptions = module.config.vim; + luajit = vimOptions.package.lua; + # build a vim plugin with the given name and arguments # if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug # instead @@ -41,6 +43,8 @@ inputs: { inherit src; nativeBuildInputs = with pkgs.vimUtils; [ + luajit + vimCommandCheckHook vimGenDocHook neovimRequireCheckHook @@ -102,12 +106,12 @@ inputs: { luaConfig = if vimOptions.byteCompileLua - then pkgs.runCommandLocal "init.lua" {text = vimOptions.builtLuaConfigRC;} "${pkgs.luajit}/bin/luajit -bd -- - $out <<< \"$text\"" + then pkgs.runCommandLocal "init.lua" {text = vimOptions.builtLuaConfigRC;} "${luajit}/bin/luajit -bd -- - $out <<< \"$text\"" else pkgs.writeText "init.lua" vimOptions.builtLuaConfigRC; extraLuaFiles = if vimOptions.byteCompileLua - then map (file: pkgs.runCommandLocal (baseNameOf file) {} "${pkgs.luajit}/bin/luajit -bd -- ${file} $out") vimOptions.extraLuaFiles + then map (file: pkgs.runCommandLocal (baseNameOf file) {} "${luajit}/bin/luajit -bd -- ${file} $out") vimOptions.extraLuaFiles else vimOptions.extraLuaFiles; # Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to