2 This file defines the composition for Lua packages. It has
3 been factored out of all-packages.nix because there are many of
4 them. Also, because most Nix expressions for Lua packages are
5 trivial, most are actually defined here. I.e. there's no function
6 for each package in a separate file: the call to the function would
7 be almost as must code as the function itself.
20 inherit (self) callPackage;
22 buildLuaApplication = args: buildLuarocksPackage ({ namePrefix = ""; } // args);
24 buildLuarocksPackage = lib.makeOverridable (
25 callPackage ../development/interpreters/lua-5/build-luarocks-package.nix { }
28 luaLib = callPackage ../development/lua-modules/lib.nix { };
30 #define build lua package function
31 buildLuaPackage = callPackage ../development/lua-modules/generic { };
34 drv: pathListForVersion: lib.concatMapStringsSep ";" (path: "${drv}/${path}") pathListForVersion;
39 # Dont take luaPackages from "global" pkgs scope to avoid mixing lua versions
42 # helper functions for dealing with LUA_PATH and LUA_CPATH
45 getLuaPath = drv: getPath drv luaLib.luaPathList;
46 getLuaCPath = drv: getPath drv luaLib.luaCPathList;
48 inherit (callPackage ../development/interpreters/lua-5/hooks { })
49 luarocksMoveDataFolder
54 inherit buildLuaPackage buildLuarocksPackage buildLuaApplication;
67 # wraps programs in $out/bin with valid LUA_PATH/LUA_CPATH
68 wrapLua = callPackage ../development/interpreters/lua-5/wrap-lua.nix {
69 inherit (pkgs.buildPackages) makeSetupHook makeWrapper;
72 luarocks_bootstrap = toLuaModule (callPackage ../development/tools/misc/luarocks/default.nix { });
74 # a fork of luarocks used to generate nix lua derivations from rockspecs
75 luarocks-nix = toLuaModule (callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { });
77 lua-pam = callPackage (
85 version = "unstable-2015-07-03";
86 # Needed for `disabled`, overridden in buildLuaPackage
87 name = "${pname}-${version}";
89 src = fetchFromGitHub {
92 rev = "3818ee6346a976669d74a5cbc2a83ad2585c5953";
93 hash = "sha256-YlMZ5mM9Ij/9yRmgA0X1ahYVZMUx8Igj5OBvAMskqTg=";
94 fetchSubmodules = true;
97 # The makefile tries to link to `-llua<luaversion>`
101 lib.optionals stdenv.hostPlatform.isLinux [ linux-pam ]
102 ++ lib.optionals stdenv.hostPlatform.isDarwin [ openpam ];
107 install -Dm755 pam.so $out/lib/lua/${lua.luaversion}/pam.so
112 # The package does not build with lua 5.4 or luaJIT
113 disabled = luaAtLeast "5.4" || isLuaJIT;
116 description = "Lua module for PAM authentication";
117 homepage = "https://github.com/devurandom/lua-pam";
118 license = licenses.mit;
119 maintainers = with maintainers; [ traxys ];
124 lua-resty-core = callPackage (
126 buildLuaPackage rec {
127 pname = "lua-resty-core";
130 src = fetchFromGitHub {
132 repo = "lua-resty-core";
134 sha256 = "sha256-RJ2wcHTu447wM0h1fa2qCBl4/p9XL6ZqX9pktRW64RI=";
137 propagatedBuildInputs = [ lua-resty-lrucache ];
140 description = "New FFI-based API for lua-nginx-module";
141 homepage = "https://github.com/openresty/lua-resty-core";
142 license = licenses.bsd3;
148 lua-resty-lrucache = callPackage (
150 buildLuaPackage rec {
151 pname = "lua-resty-lrucache";
154 src = fetchFromGitHub {
156 repo = "lua-resty-lrucache";
158 sha256 = "sha256-J8RNAMourxqUF8wPKd8XBhNwGC/x1KKvrVnZtYDEu4Q=";
162 description = "Lua-land LRU Cache based on LuaJIT FFI";
163 homepage = "https://github.com/openresty/lua-resty-lrucache";
164 license = licenses.bsd3;
170 luxio = callPackage (
176 buildLuaPackage rec {
181 url = "https://git.gitano.org.uk/luxio.git/snapshot/luxio-luxio-${version}.tar.bz2";
182 sha256 = "1hvwslc25q7k82rxk461zr1a2041nxg7sn3sw3w0y5jxf0giz2pz";
185 nativeBuildInputs = [
191 patchShebangs const-proc.lua
196 INST_LIBDIR="$out/lib/lua/${lua.luaversion}"
197 INST_LUADIR="$out/share/lua/${lua.luaversion}"
198 LUA_BINDIR="$out/bin"
204 broken = stdenv.hostPlatform.isDarwin;
205 description = "Lightweight UNIX I/O and POSIX binding for Lua";
206 homepage = "https://www.gitano.org.uk/luxio/";
207 license = licenses.mit;
208 maintainers = with maintainers; [ richardipsum ];
209 platforms = platforms.unix;
214 nfd = callPackage ../development/lua-modules/nfd {
215 inherit (pkgs) zenity;
216 inherit (pkgs.darwin.apple_sdk.frameworks) AppKit;
219 vicious = callPackage (
221 stdenv.mkDerivation rec {
225 src = fetchFromGitHub {
226 owner = "vicious-widgets";
229 sha256 = "sha256-VlJ2hNou2+t7eSyHmFkC2xJ92OH/uJ/ewYHkFLQjUPQ=";
232 buildInputs = [ lua ];
235 mkdir -p $out/lib/lua/${lua.luaversion}/
236 cp -r . $out/lib/lua/${lua.luaversion}/vicious/
237 printf "package.path = '$out/lib/lua/${lua.luaversion}/?/init.lua;' .. package.path\nreturn require((...) .. '.init')\n" > $out/lib/lua/${lua.luaversion}/vicious.lua
241 description = "Modular widget library for the awesome window manager";
242 homepage = "https://vicious.rtfd.io";
243 changelog = "https://vicious.rtfd.io/en/v${version}/changelog.html";
244 license = licenses.gpl2Plus;
245 maintainers = with maintainers; [
250 platforms = platforms.linux;