1 /* This file defines the composition for Lua packages. It has
2 been factored out of all-packages.nix because there are many of
3 them. Also, because most Nix expressions for Lua packages are
4 trivial, most are actually defined here. I.e. there's no function
5 for each package in a separate file: the call to the function would
6 be almost as must code as the function itself. */
18 inherit (self) callPackage;
20 buildLuaApplication = args: buildLuarocksPackage ({ namePrefix = ""; } // args);
22 buildLuarocksPackage = lib.makeOverridable (callPackage ../development/interpreters/lua-5/build-luarocks-package.nix { });
24 luaLib = callPackage ../development/lua-modules/lib.nix { };
26 #define build lua package function
27 buildLuaPackage = callPackage ../development/lua-modules/generic { };
29 getPath = drv: pathListForVersion:
30 lib.concatMapStringsSep ";" (path: "${drv}/${path}") pathListForVersion;
35 # Dont take luaPackages from "global" pkgs scope to avoid mixing lua versions
38 # helper functions for dealing with LUA_PATH and LUA_CPATH
41 getLuaPath = drv: getPath drv luaLib.luaPathList;
42 getLuaCPath = drv: getPath drv luaLib.luaCPathList;
44 inherit (callPackage ../development/interpreters/lua-5/hooks { })
45 luarocksMoveDataFolder luarocksCheckHook lua-setup-hook;
48 inherit buildLuaPackage buildLuarocksPackage buildLuaApplication;
49 inherit (luaLib) luaOlder luaAtLeast isLua51 isLua52 isLua53 isLuaJIT
50 requiredLuaModules toLuaModule hasLuaModule;
52 # wraps programs in $out/bin with valid LUA_PATH/LUA_CPATH
53 wrapLua = callPackage ../development/interpreters/lua-5/wrap-lua.nix {
54 inherit (pkgs.buildPackages) makeSetupHook makeWrapper;
57 luarocks = toLuaModule (callPackage ../development/tools/misc/luarocks/default.nix { });
59 # a fork of luarocks used to generate nix lua derivations from rockspecs
60 luarocks-nix = toLuaModule (callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { });
62 lua-resty-core = callPackage ({ fetchFromGitHub }: buildLuaPackage rec {
63 pname = "lua-resty-core";
66 src = fetchFromGitHub {
68 repo = "lua-resty-core";
70 sha256 = "sha256-obwyxHSot1Lb2c1dNqJor3inPou+UIBrqldbkNBCQQk=";
73 propagatedBuildInputs = [ lua-resty-lrucache ];
76 description = "New FFI-based API for lua-nginx-module";
77 homepage = "https://github.com/openresty/lua-resty-core";
78 license = licenses.bsd3;
79 maintainers = with maintainers; [ ];
83 lua-resty-lrucache = callPackage ({ fetchFromGitHub }: buildLuaPackage rec {
84 pname = "lua-resty-lrucache";
87 src = fetchFromGitHub {
89 repo = "lua-resty-lrucache";
91 sha256 = "sha256-J8RNAMourxqUF8wPKd8XBhNwGC/x1KKvrVnZtYDEu4Q=";
95 description = "Lua-land LRU Cache based on LuaJIT FFI";
96 homepage = "https://github.com/openresty/lua-resty-lrucache";
97 license = licenses.bsd3;
98 maintainers = with maintainers; [ ];
102 luxio = callPackage ({ fetchurl, which, pkg-config }: buildLuaPackage rec {
107 url = "https://git.gitano.org.uk/luxio.git/snapshot/luxio-luxio-${version}.tar.bz2";
108 sha256 = "1hvwslc25q7k82rxk461zr1a2041nxg7sn3sw3w0y5jxf0giz2pz";
111 nativeBuildInputs = [ which pkg-config ];
114 patchShebangs const-proc.lua
119 INST_LIBDIR="$out/lib/lua/${lua.luaversion}"
120 INST_LUADIR="$out/share/lua/${lua.luaversion}"
121 LUA_BINDIR="$out/bin"
127 broken = stdenv.isDarwin;
128 description = "Lightweight UNIX I/O and POSIX binding for Lua";
129 homepage = "https://www.gitano.org.uk/luxio/";
130 license = licenses.mit;
131 maintainers = with maintainers; [ richardipsum ];
132 platforms = platforms.unix;
136 nfd = callPackage ../development/lua-modules/nfd {
137 inherit (pkgs.gnome) zenity;
138 inherit (pkgs.darwin.apple_sdk.frameworks) AppKit;
141 vicious = callPackage ({ fetchFromGitHub }: stdenv.mkDerivation rec {
145 src = fetchFromGitHub {
146 owner = "vicious-widgets";
149 sha256 = "sha256-VlJ2hNou2+t7eSyHmFkC2xJ92OH/uJ/ewYHkFLQjUPQ=";
152 buildInputs = [ lua ];
155 mkdir -p $out/lib/lua/${lua.luaversion}/
156 cp -r . $out/lib/lua/${lua.luaversion}/vicious/
157 printf "package.path = '$out/lib/lua/${lua.luaversion}/?/init.lua;' .. package.path\nreturn require((...) .. '.init')\n" > $out/lib/lua/${lua.luaversion}/vicious.lua
161 description = "A modular widget library for the awesome window manager";
162 homepage = "https://vicious.rtfd.io";
163 changelog = "https://vicious.rtfd.io/en/v${version}/changelog.html";
164 license = licenses.gpl2Plus;
165 maintainers = with maintainers; [ makefu mic92 McSinyx ];
166 platforms = platforms.linux;