From a57dac5b77dc0718f1c5a0d6e809ed5e1f3d14ac Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Sat, 11 Jun 2022 17:32:28 +0200 Subject: [PATCH] Add fennel-luajit overlay --- README.md | 1 + overlay.nix | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index e40f48a..0fc0555 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ * [agilebits-op](https://app-updates.agilebits.com/product_history/CLI2) * [cliclick](https://github.com/BlueM/cliclick) +* fennel-luajit * [phantomjs](https://github.com/ariya/phantomjs) * [proximity-sort](https://github.com/jonhoo/proximity-sort) * [q](https://github.com/natesales/q) diff --git a/overlay.nix b/overlay.nix index 83a7bc0..1e77930 100644 --- a/overlay.nix +++ b/overlay.nix @@ -8,4 +8,19 @@ let custom = super.callPackage ./packages.nix { }; in inherit (custom) phantomjs; inherit (custom) proximity-sort; inherit (custom) q; + + fennel-luajit = super.fennel.overrideAttrs ( + let + luaPackages = with super.luajitPackages; [ readline ]; + in + o: rec { + buildInputs = [ super.luajit super.makeWrapper ] ++ luaPackages; + + postInstall = o.postInstall or "" + '' + wrapProgram $out/bin/fennel \ + --suffix LUA_CPATH ";" "${super.lib.concatMapStringsSep ";" super.luajitPackages.getLuaCPath luaPackages}" \ + --suffix LUA_PATH ";" "${super.lib.concatMapStringsSep ";" super.luajitPackages.getLuaPath luaPackages}" + ''; + } + ); }