From 7edacad9b7f5fe13eff162dcbcdc35138bab7ffe Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 19:18:08 +0200 Subject: [PATCH] sile: make it easier to setup a modified luaEnv when writing documents --- pkgs/by-name/si/sile/package.nix | 61 ++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/pkgs/by-name/si/sile/package.nix b/pkgs/by-name/si/sile/package.nix index 20a14a34bda3..1a64d5981d20 100644 --- a/pkgs/by-name/si/sile/package.nix +++ b/pkgs/by-name/si/sile/package.nix @@ -110,41 +110,48 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; passthru = { - luaEnv = lua.withPackages ( - ps: - with ps; + # Use this passthru variable to add packages to your lua environment. Use + # something like this in your development environment: + # + # myLuaEnv = lua.withPackages ( + # ps: lib.attrVals (sile.passthru.luaPackages ++ [ + # "lua-cjson" + # "lua-resty-http" + # ]) ps + # ) + luaPackages = [ - cassowary - cldr - fluent - linenoise - loadkit - lpeg - lua-zlib - lua_cliargs - luaepnf - luaexpat - luafilesystem - luarepl - luasec - luasocket - luautf8 - penlight - vstruct + "cassowary" + "cldr" + "fluent" + "linenoise" + "loadkit" + "lpeg" + "lua-zlib" + "lua_cliargs" + "luaepnf" + "luaexpat" + "luafilesystem" + "luarepl" + "luasec" + "luasocket" + "luautf8" + "penlight" + "vstruct" # lua packages needed for testing - busted - luacheck + "busted" + "luacheck" # packages needed for building api docs - ldoc + "ldoc" # NOTE: Add lua packages here, to change the luaEnv also read by `flake.nix` ] ++ lib.optionals (lib.versionOlder lua.luaversion "5.2") [ - bit32 + "bit32" ] ++ lib.optionals (lib.versionOlder lua.luaversion "5.3") [ - compat53 - ] - ); + "compat53" + ]; + luaEnv = lua.withPackages (ps: lib.attrVals finalAttrs.finalPackage.passthru.luaPackages ps); # Copied from Makefile.am tests.test = lib.optionalAttrs (!(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) (