From b596934b7a058e940fd1eb34d9c94472cd134d16 Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 19 Jan 2026 01:21:18 +0200 Subject: [PATCH 1/2] luaPackages.wrapLua: Fix the wrapper on cross The wrapper was using a makeWrapper targeting the buildPlatform This is a leftover from a fix I did before I converted luaPackages to use makeScopeWithSplicing Fixes: https://www.github.com/NixOS/nixpkgs/issues/481454 --- pkgs/top-level/lua-packages.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index bc5b3bb649ae..e2a42938108b 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -65,9 +65,7 @@ rec { ; # wraps programs in $out/bin with valid LUA_PATH/LUA_CPATH - wrapLua = callPackage ../development/interpreters/lua-5/wrap-lua.nix { - inherit (pkgs.buildPackages) makeSetupHook makeWrapper; - }; + wrapLua = callPackage ../development/interpreters/lua-5/wrap-lua.nix { }; luarocks_bootstrap = toLuaModule (callPackage ../development/tools/misc/luarocks/default.nix { }); From e1e2f27c78a0b117726780ccb5eda09f88868328 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 20 Jan 2026 15:20:05 +0200 Subject: [PATCH 2/2] luaPackages.buildLuarocksPackage: Get the final derivation picked by mkDerivation instead of using the raw list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` … while evaluating attribute 'propagatedBuildInputs' of derivation 'wrap-lua-hook' at /home/art/nixgits/my-nixpkgs/pkgs/stdenv/generic/make-derivation.nix:600:13: 599| depsHostHostPropagated = elemAt (elemAt propagatedDependencies 1) 0; 600| propagatedBuildInputs = elemAt (elemAt propagatedDependencies 1) 1; | ^ 601| depsTargetTargetPropagated = elemAt (elemAt propagatedDependencies 2) 0; … while calling the 'getAttr' builtin at «nix-internal»/derivation-internal.nix:50:17: 49| value = commonAttrs // { 50| outPath = builtins.getAttr outputName strict; | ^ 51| drvPath = strict.drvPath; … while calling the 'derivationStrict' builtin at «nix-internal»/derivation-internal.nix:37:12: 36| 37| strict = derivationStrict drvAttrs; | ^ 38| … while evaluating derivation 'make-shell-wrapper-hook' whose name attribute is located at /home/art/nixgits/my-nixpkgs/pkgs/stdenv/generic/make-derivation.nix:541:13 … while evaluating attribute 'shell' of derivation 'make-shell-wrapper-hook' at /home/art/nixgits/my-nixpkgs/pkgs/top-level/all-packages.nix:716:7: 715| # targetPackages.runtimeShell only exists when pkgs == targetPackages (when targetPackages is not __raw) 716| shell = | ^ 717| if targetPackages ? runtimeShell then … while calling the 'throw' builtin at /home/art/nixgits/my-nixpkgs/pkgs/top-level/all-packages.nix:720:11: 719| else 720| throw "makeWrapper/makeShellWrapper must be in nativeBuildInputs"; | ^ 721| }; error: makeWrapper/makeShellWrapper must be in nativeBuildInputs ``` --- .../development/interpreters/lua-5/build-luarocks-package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/build-luarocks-package.nix b/pkgs/development/interpreters/lua-5/build-luarocks-package.nix index 736c9463521f..2c7450aa40d2 100644 --- a/pkgs/development/interpreters/lua-5/build-luarocks-package.nix +++ b/pkgs/development/interpreters/lua-5/build-luarocks-package.nix @@ -142,7 +142,7 @@ let luarocksConfig = let externalDepsGenerated = lib.filter (drv: !drv ? luaModule) ( - self.nativeBuildInputs ++ self.propagatedBuildInputs ++ self.buildInputs + self.finalPackage.nativeBuildInputs ++ self.propagatedBuildInputs ++ self.buildInputs ); generatedConfig = luaLib.generateLuarocksConfig { @@ -157,7 +157,7 @@ let # closure, as it doesn't have a rock tree :) # luaLib.hasLuaModule requiredLuaRocks = lib.filter luaLib.hasLuaModule ( - lua.pkgs.requiredLuaModules (self.nativeBuildInputs ++ self.propagatedBuildInputs) + lua.pkgs.requiredLuaModules (self.finalPackage.nativeBuildInputs ++ self.propagatedBuildInputs) ); };