From 41687e916dd0bf5186f51a7b98befa76e60430b8 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 2 Jul 2023 18:19:54 +0100 Subject: [PATCH] rename luaSmall package to lua --- examples/acquire-delegated-prefix.nix | 5 +---- overlay.nix | 4 +++- pkgs/ifwait/default.nix | 9 +++------ pkgs/write-fennel-script/default.nix | 8 ++++---- tests/fennel/test.nix | 4 ++-- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/examples/acquire-delegated-prefix.nix b/examples/acquire-delegated-prefix.nix index 3356ec9..90d7d60 100644 --- a/examples/acquire-delegated-prefix.nix +++ b/examples/acquire-delegated-prefix.nix @@ -1,10 +1,7 @@ { writeFennelScript -, luaSmall , linotify }: writeFennelScript "acquire-delegated-prefix" - [ - (linotify.override { lua = luaSmall; }) - ] + [ linotify ] ./acquire-delegated-prefix.fnl diff --git a/overlay.nix b/overlay.nix index fcd70a0..06aaa2a 100644 --- a/overlay.nix +++ b/overlay.nix @@ -39,6 +39,7 @@ let (if o ? patches then o.patches else []) ++ (if patch_needed then [ patch ] else []); }); + lua = let s = lua_no_readline.override { self = s; }; in s; in extraPkgs // { mtdutils = prev.mtdutils.overrideAttrs(o: { @@ -97,7 +98,8 @@ extraPkgs // { ]; }); - luaSmall = let s = lua_no_readline.override { self = s; }; in s; + luaFull = prev.lua; + inherit lua; inherit s6; s6-linux-init = prev.s6-linux-init.override { diff --git a/pkgs/ifwait/default.nix b/pkgs/ifwait/default.nix index 27691b4..7a3ca73 100644 --- a/pkgs/ifwait/default.nix +++ b/pkgs/ifwait/default.nix @@ -1,13 +1,10 @@ { - luaSmall + lua , netlink-lua , writeFennelScript , runCommand }: -let - lua = luaSmall; - netlink = netlink-lua.override {inherit lua;}; -in runCommand "ifwait" {} '' +runCommand "ifwait" {} '' mkdir -p $out/bin - cp -p ${writeFennelScript "ifwait" [netlink] ./ifwait.fnl} $out/bin/ifwait + cp -p ${writeFennelScript "ifwait" [netlink-lua] ./ifwait.fnl} $out/bin/ifwait '' diff --git a/pkgs/write-fennel-script/default.nix b/pkgs/write-fennel-script/default.nix index 60145ab..6eb5445 100644 --- a/pkgs/write-fennel-script/default.nix +++ b/pkgs/write-fennel-script/default.nix @@ -1,6 +1,6 @@ { runCommand -, luaSmall +, lua , runtimeShell , fetchurl , lib @@ -14,15 +14,15 @@ in name : packages : source : hash = "sha256-hYSD3rBYF8iTjBOA1m+TvUu8BSp8q6uIMUXi0xwo/dU="; }; - luapath = builtins.map (f: "${f}/share/lua/${luaSmall.luaversion}/?.lua;") packages; - luacpath = builtins.map (f: "${f}/lib/lua/${luaSmall.luaversion}/?.so;") packages; + luapath = builtins.map (f: "${f}/share/lua/${lua.luaversion}/?.lua;") packages; + luacpath = builtins.map (f: "${f}/lib/lua/${lua.luaversion}/?.so;") packages; in runCommand name { nativeBuildInputs = [ lua ]; } '' echo $PATH #!${runtimeShell} ( - echo "#!${luaSmall}/bin/lua" + echo "#!${lua}/bin/lua" echo "package.path = ${lib.strings.escapeShellArg luapath} .. package.path" echo "package.cpath = ${lib.strings.escapeShellArg luacpath} .. package.cpath" lua ${fennel} --correlate --compile ${source} diff --git a/tests/fennel/test.nix b/tests/fennel/test.nix index 5f874c3..fda2a89 100644 --- a/tests/fennel/test.nix +++ b/tests/fennel/test.nix @@ -6,8 +6,8 @@ let overlay = import "${liminix}/overlay.nix"; pkgs = import { overlays = [overlay]; }; script = pkgs.writeFennelScript "foo" [] ./hello.fnl; - inherit (pkgs.luaSmall.pkgs) fifo; - netlink = pkgs.netlink-lua.override { lua = pkgs.luaSmall; }; + inherit (pkgs.lua.pkgs) fifo; + netlink = pkgs.netlink-lua; script2 = pkgs.writeFennelScript "foo2" [fifo netlink] ./hello.fnl; in pkgs.runCommand "check" { } ''