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-lua-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 = callPackage ../development/tools/misc/luarocks/default.nix { };
59 # a fork of luarocks used to generate nix lua derivations from rockspecs
60 luarocks-nix = callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { };
62 luxio = callPackage ({ fetchurl, which, pkg-config }: buildLuaPackage {
67 url = "https://git.gitano.org.uk/luxio.git/snapshot/luxio-luxio-13.tar.bz2";
68 sha256 = "1hvwslc25q7k82rxk461zr1a2041nxg7sn3sw3w0y5jxf0giz2pz";
71 nativeBuildInputs = [ which pkg-config ];
79 INST_LIBDIR="$out/lib/lua/${lua.luaversion}"
80 INST_LUADIR="$out/share/lua/${lua.luaversion}"
87 broken = stdenv.isDarwin;
88 description = "Lightweight UNIX I/O and POSIX binding for Lua";
89 homepage = "https://www.gitano.org.uk/luxio/";
90 license = licenses.mit;
91 maintainers = with maintainers; [ richardipsum ];
92 platforms = platforms.unix;
96 nfd = callPackage ../development/lua-modules/nfd {
97 inherit (pkgs.gnome) zenity;
100 vicious = (callPackage ({ fetchFromGitHub }: stdenv.mkDerivation rec {
104 src = fetchFromGitHub {
105 owner = "vicious-widgets";
108 sha256 = "sha256-geu/g/dFAVxtY1BuJYpZoVtFS/oL66NFnqiLAnJELtI=";
111 buildInputs = [ lua ];
114 mkdir -p $out/lib/lua/${lua.luaversion}/
115 cp -r . $out/lib/lua/${lua.luaversion}/vicious/
116 printf "package.path = '$out/lib/lua/${lua.luaversion}/?/init.lua;' .. package.path\nreturn require((...) .. '.init')\n" > $out/lib/lua/${lua.luaversion}/vicious.lua
120 description = "A modular widget library for the awesome window manager";
121 homepage = "https://vicious.rtfd.io";
122 license = licenses.gpl2Plus;
123 maintainers = with maintainers; [ makefu mic92 McSinyx ];
124 platforms = platforms.linux;