From 5cfcfc300b6742dcdac074eb63d025b555e062c0 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Wed, 6 Feb 2019 13:57:53 +0900 Subject: doc: update lua documentation Reflects the recent changes to the lua infrastructure. Packaging from luarocks should be encouraged. --- doc/languages-frameworks/index.xml | 2 +- doc/languages-frameworks/lua.section.md | 237 ++++++++++++++++++++++++++++++++ 2 files changed, 238 insertions(+), 1 deletion(-) create mode 100644 doc/languages-frameworks/lua.section.md (limited to 'doc') diff --git a/doc/languages-frameworks/index.xml b/doc/languages-frameworks/index.xml index 2414956995c0..728a38c264a3 100644 --- a/doc/languages-frameworks/index.xml +++ b/doc/languages-frameworks/index.xml @@ -18,7 +18,7 @@ - + diff --git a/doc/languages-frameworks/lua.section.md b/doc/languages-frameworks/lua.section.md new file mode 100644 index 000000000000..b4b593af7496 --- /dev/null +++ b/doc/languages-frameworks/lua.section.md @@ -0,0 +1,237 @@ +--- +title: Lua +author: Matthieu Coudron +date: 2019-02-05 +--- + +# User's Guide to Lua Infrastructure + +## Using Lua + +### Overview of Lua + +Several versions of the Lua interpreter are available: luajit, lua5.1, 5.2, 5.3. +The attribute `lua` refers to the default interpreter, it is also possible to refer to specific versions, e.g. `lua_52` refers to Lua 5.2. + +Lua libraries are in separate sets, with one set per interpreter version. + +The interpreters have several common attributes. One of these attributes is +`pkgs`, which is a package set of Lua libraries for this specific +interpreter. E.g., the `busted` package corresponding to the default interpreter +is `lua.pkgs.busted`, and the lua 5.2 version is lua_52.pkgs.busted`. +The main package set contains aliases to these package sets, e.g. +`luaPackages` refers to `lua_51.pkgs` and `lua_52Packages` to +`lua_52.pkgs`. + +### Installing Lua and packages + +#### Lua environment defined in separate `.nix` file + +Create a file, e.g. `build.nix`, with the following expression +```nix +with import {}; + +lua_52.withPackages (ps: with ps; [ busted luafilesystem ]) +``` +and install it in your profile with +```shell +nix-env -if build.nix +``` +Now you can use the Lua interpreter, as well as the extra packages (`busted`, +`luafilesystem`) that you added to the environment. + +#### Lua environment defined in `~/.config/nixpkgs/config.nix` + +If you prefer to, you could also add the environment as a package override to the Nixpkgs set, e.g. +using `config.nix`, +```nix +{ # ... + + packageOverrides = pkgs: with pkgs; { + myLuaEnv = lua_52.withPackages (ps: with ps; [ busted luafilesystem ]); + }; +} +``` +and install it in your profile with +```shell +nix-env -iA nixpkgs.myLuaEnv +``` +The environment is is installed by referring to the attribute, and considering +the `nixpkgs` channel was used. + +#### Lua environment defined in `/etc/nixos/configuration.nix` + +For the sake of completeness, here's another example how to install the environment system-wide. + +```nix +{ # ... + + environment.systemPackages = with pkgs; [ + (lua.withPackages(ps: with ps; [ busted luafilesystem ])) + ]; +} +``` + +### Temporary Lua environment with `nix-shell` + +For development you may need to use multiple environments. +`nix-shell` gives the possibility to temporarily load another environment, akin +to `virtualenv`. + +There are two methods for loading a shell with Lua packages. The first and recommended method +is to create an environment with `lua.buildEnv` or `lua.withPackages` and load that. E.g. +```sh +$ nix-shell -p 'lua.withPackages(ps: with ps; [ busted luafilesystem ])' +``` +opens a shell from which you can launch the interpreter +```sh +[nix-shell:~] lua +``` +The other method, which is not recommended, does not create an environment and requires you to list the packages directly, + +```sh +$ nix-shell -p lua.pkgs.busted lua.pkgs.luafilesystem +``` +Again, it is possible to launch the interpreter from the shell. +The Lua interpreter has the attribute `pkgs` which contains all Lua libraries for that specific interpreter. + + +## Developing with Lua + +Now that you know how to get a working Lua environment with Nix, it is time +to go forward and start actually developing with Lua. There are two ways to +package lua software, either it is on luarocks and most of it can be taken care +of by the luarocks2nix converter or the packaging has to be done manually. +Let's present the luarocks way first and the manual one in a second time. + +### Packaging a library on luarocks + +[Luarocks.org](www.luarocks.org) is the main repository of lua packages. The site proposes two types of packages, the rockspec and the src.rock (equivalent of a rockspec but with the source). These packages can have different build types such as `cmake`, `builtin` etc (See https://github.com/luarocks/luarocks/wiki/Rockspec-format). + +Luarocks-based packages are generated in pkgs/development/lua-modules/generated-packages.nix from +the whitelist maintainers/scripts/luarocks-packages.csv and updated by running maintainers/scripts/update-luarocks-packages. + +[luarocks2nix](https://github.com/teto/luarocks) is a tool capable of generating nix derivations from both rockspec and src.rock (and favors the src.rock). +The automation only goes so far though and some packages need some customization. +These go in pkgs/development/lua-modules/generated-packages.nix +nix won't work with all packages. If the package lists `external_dependencies` in its rockspec file then it won't work. + +You can run `nix-shell -p luarocks-nix` and then `luarocks nix PKG_NAME`. +Nix rely on luarocks to install lua packages, basically it runs: +`luarocks make --deps-mode=none --tree $out` + +#### Packaging a library manually + +You can develop your package as you usually would, just don't forget to wrap it +within a `toLuaModule` call, for instance +```nix +mynewlib = toLuaModule ( stdenv.mkDerivation { ... }); +``` + + + +## Lua Reference + +### Lua interpreters + +Versions 5.1, 5.2 and 5.3 of the lua interpreter are available as +respectively `lua_51`, `lua_52` and `lua_53`. The luajit interpreter is also available. +The Nix expressions for the interpreters can be found in `pkgs/development/interpreters/lua`. + + +#### Attributes on lua interpreters packages + +Each interpreter has the following attributes: + +- `interpreter`. Alias for `${lua}/bin/lua`. +- `buildEnv`. Function to build python interpreter environments with extra packages bundled together. See section *python.buildEnv function* for usage and documentation. +- `withPackages`. Simpler interface to `buildEnv`. +- `pkgs`. Set of Lua packages for that specific interpreter. The package set can be modified by overriding the interpreter and passing `packageOverrides`. + + +#### `buildLuarocksPackage` function + +The `buildLuarocksPackage` function is implemented in `pkgs/development/interpreters/lua-5/build-lua-package.nix` +The following is an example: +```nix +luaexpat = buildLuaPackage rec { + pname = "luaexpat"; + version = "1.3.0-1"; + + src = fetchurl { + url = https://luarocks.org/luaexpat-1.3.0-1.src.rock; + sha256 = "15jqz5q12i9zvjyagzwz2lrpzya64mih8v1hxwr0wl2gsjh86y5a"; + }; + disabled = luaOlder "5.1"; + + propagatedBuildInputs = [ lua ]; + + buildType="builtin"; + + meta = { + homepage = http://www.keplerproject.org/luaexpat/; + description="XML Expat parsing"; + license = { + fullName = "MIT/X11"; + }; + }; +}; +``` + +The `buildLuarocksPackage` delegates most tasks to luarocks: + +* it adds `luarocks` as an unpacker for `src.rock` files (in fact zip files) +* configurePhase` writes a temporary luarocks configuration file which location +is exported via the environment variable `LUAROCKS_CONFIG`. +* In the `buildPhase`, nothing is done. +* `installPhase` calls `luarocks make --deps-mode=none --tree $out` to build and +install the package +* In the `postFixup` phase, the `wrapLuaPrograms` bash function is called to + wrap all programs in the `$out/bin/*` directory to include `$PATH` + environment variable and add dependent libraries to script's `LUA_PATH` and + `LUA_CPATH`. + +By default `meta.platforms` is set to the same value +as the interpreter unless overridden otherwise. + +#### `buildLuaApplication` function + +The `buildLuaApplication` function is practically the same as `buildLuaPackage`. +The difference is that `buildLuaPackage` by default prefixes the names of the packages with the version of the interpreter. +Because with an application we're not interested in multiple version the prefix is dropped. + +#### lua.withPackages function + +The `lua.withPackages` function provides a simpler interface to the `python.buildEnv` functionality. +It takes a function as an argument that is passed the set of python packages and returns the list +of the packages to be included in the environment. Using the `withPackages` function, the previous +example for the luafilesystem environment can be written like this: +```nix +with import {}; + +lua.withPackages (ps: [ps.luafilesystem]) +``` + +`withPackages` passes the correct package set for the specific interpreter version as an argument to the function. In the above example, `ps` equals `luaPackages`. +But you can also easily switch to using lua_52: +```nix +with import {}; + +lua_52.withPackages (ps: [ps.lua]) +``` + +Now, `ps` is set to `lua_52Packages`, matching the version of the interpreter. + + +### Possible Todos + +* export/use version specific variables such as LUA_PATH_5_2/LUAROCKS_CONFIG_5_2 +* let luarocks check for dependencies via exporting the different rocktrees in temporary config + +### Lua Contributing guidelines + +Following rules should be respected: + +* Make sure libraries build for all Lua interpreters. +* Commit names of Lua libraries should reflect that they are Lua libraries, so write for example `lua.luafilesystem: 1.11 -> 1.12`. + -- cgit 1.4.1 From 404d057e89eb77099cd6ca8d50b79ccc52bb7914 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Thu, 7 Mar 2019 17:17:18 +0900 Subject: Added an example about overlay --- doc/languages-frameworks/lua.section.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/languages-frameworks/lua.section.md b/doc/languages-frameworks/lua.section.md index b4b593af7496..f11a1a5862ec 100644 --- a/doc/languages-frameworks/lua.section.md +++ b/doc/languages-frameworks/lua.section.md @@ -72,6 +72,27 @@ For the sake of completeness, here's another example how to install the environm } ``` +### How to override a Python package using overlays? + +Use the following overlay template: + +```nix +self: prev: +{ + + lua = prev.lua.override { + packageOverrides = luaself: luaprev: { + + luarocks-nix = luaprev.luarocks-nix.overrideAttrs(oa: { + pname = "toto"; + src = /home/my_luarocks/repository; + }); + }; + + luaPackages = lua.pkgs; +} +``` + ### Temporary Lua environment with `nix-shell` For development you may need to use multiple environments. @@ -154,7 +175,7 @@ Each interpreter has the following attributes: The `buildLuarocksPackage` function is implemented in `pkgs/development/interpreters/lua-5/build-lua-package.nix` The following is an example: ```nix -luaexpat = buildLuaPackage rec { +luaexpat = buildLuarocksPackage rec { pname = "luaexpat"; version = "1.3.0-1"; -- cgit 1.4.1 From 2909dc9f3988551b5b31a89a162d825511fca5ca Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sat, 18 May 2019 21:51:16 +0900 Subject: builds --- doc/languages-frameworks/lua.section.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/languages-frameworks/lua.section.md b/doc/languages-frameworks/lua.section.md index f11a1a5862ec..21fe3f21e092 100644 --- a/doc/languages-frameworks/lua.section.md +++ b/doc/languages-frameworks/lua.section.md @@ -72,7 +72,7 @@ For the sake of completeness, here's another example how to install the environm } ``` -### How to override a Python package using overlays? +### How to override a Lua package using overlays? Use the following overlay template: @@ -165,7 +165,7 @@ The Nix expressions for the interpreters can be found in `pkgs/development/inter Each interpreter has the following attributes: - `interpreter`. Alias for `${lua}/bin/lua`. -- `buildEnv`. Function to build python interpreter environments with extra packages bundled together. See section *python.buildEnv function* for usage and documentation. +- `buildEnv`. Function to build lua interpreter environments with extra packages bundled together. See section *lua.buildEnv function* for usage and documentation. - `withPackages`. Simpler interface to `buildEnv`. - `pkgs`. Set of Lua packages for that specific interpreter. The package set can be modified by overriding the interpreter and passing `packageOverrides`. @@ -223,10 +223,8 @@ Because with an application we're not interested in multiple version the prefix #### lua.withPackages function -The `lua.withPackages` function provides a simpler interface to the `python.buildEnv` functionality. -It takes a function as an argument that is passed the set of python packages and returns the list -of the packages to be included in the environment. Using the `withPackages` function, the previous -example for the luafilesystem environment can be written like this: +The `lua.withPackages` takes a function as an argument that is passed the set of lua packages and returns the list of packages to be included in the environment. +Using the `withPackages` function, the previous example for the luafilesystem environment can be written like this: ```nix with import {}; -- cgit 1.4.1 From 3042b38ce107a0380793883d58cd32d84fff9cf6 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sat, 6 Jun 2020 19:53:58 +0200 Subject: update --- doc/languages-frameworks/lua.section.md | 88 ++++++++++++++++----------------- doc/languages-frameworks/lua.xml | 36 -------------- 2 files changed, 42 insertions(+), 82 deletions(-) delete mode 100644 doc/languages-frameworks/lua.xml (limited to 'doc') diff --git a/doc/languages-frameworks/lua.section.md b/doc/languages-frameworks/lua.section.md index 21fe3f21e092..058b8f45c988 100644 --- a/doc/languages-frameworks/lua.section.md +++ b/doc/languages-frameworks/lua.section.md @@ -10,7 +10,7 @@ date: 2019-02-05 ### Overview of Lua -Several versions of the Lua interpreter are available: luajit, lua5.1, 5.2, 5.3. +Several versions of the Lua interpreter are available: luajit, lua 5.1, 5.2, 5.3. The attribute `lua` refers to the default interpreter, it is also possible to refer to specific versions, e.g. `lua_52` refers to Lua 5.2. Lua libraries are in separate sets, with one set per interpreter version. @@ -18,10 +18,10 @@ Lua libraries are in separate sets, with one set per interpreter version. The interpreters have several common attributes. One of these attributes is `pkgs`, which is a package set of Lua libraries for this specific interpreter. E.g., the `busted` package corresponding to the default interpreter -is `lua.pkgs.busted`, and the lua 5.2 version is lua_52.pkgs.busted`. +is `lua.pkgs.busted`, and the lua 5.2 version is `lua5_2.pkgs.busted`. The main package set contains aliases to these package sets, e.g. -`luaPackages` refers to `lua_51.pkgs` and `lua_52Packages` to -`lua_52.pkgs`. +`luaPackages` refers to `lua5_1.pkgs` and `lua52Packages` to +`lua5_2.pkgs`. ### Installing Lua and packages @@ -31,7 +31,7 @@ Create a file, e.g. `build.nix`, with the following expression ```nix with import {}; -lua_52.withPackages (ps: with ps; [ busted luafilesystem ]) +lua5_2.withPackages (ps: with ps; [ busted luafilesystem ]) ``` and install it in your profile with ```shell @@ -77,14 +77,14 @@ For the sake of completeness, here's another example how to install the environm Use the following overlay template: ```nix -self: prev: +final: prev: { lua = prev.lua.override { packageOverrides = luaself: luaprev: { luarocks-nix = luaprev.luarocks-nix.overrideAttrs(oa: { - pname = "toto"; + pname = "luarocks-nix"; src = /home/my_luarocks/repository; }); }; @@ -95,9 +95,6 @@ self: prev: ### Temporary Lua environment with `nix-shell` -For development you may need to use multiple environments. -`nix-shell` gives the possibility to temporarily load another environment, akin -to `virtualenv`. There are two methods for loading a shell with Lua packages. The first and recommended method is to create an environment with `lua.buildEnv` or `lua.withPackages` and load that. E.g. @@ -127,17 +124,20 @@ Let's present the luarocks way first and the manual one in a second time. ### Packaging a library on luarocks -[Luarocks.org](www.luarocks.org) is the main repository of lua packages. The site proposes two types of packages, the rockspec and the src.rock (equivalent of a rockspec but with the source). These packages can have different build types such as `cmake`, `builtin` etc (See https://github.com/luarocks/luarocks/wiki/Rockspec-format). +[Luarocks.org](www.luarocks.org) is the main repository of lua packages. +The site proposes two types of packages, the rockspec and the src.rock +(equivalent of a [rockspec](https://github.com/luarocks/luarocks/wiki/Rockspec-format) but with the source). +These packages can have different build types such as `cmake`, `builtin` etc . Luarocks-based packages are generated in pkgs/development/lua-modules/generated-packages.nix from the whitelist maintainers/scripts/luarocks-packages.csv and updated by running maintainers/scripts/update-luarocks-packages. -[luarocks2nix](https://github.com/teto/luarocks) is a tool capable of generating nix derivations from both rockspec and src.rock (and favors the src.rock). -The automation only goes so far though and some packages need some customization. -These go in pkgs/development/lua-modules/generated-packages.nix -nix won't work with all packages. If the package lists `external_dependencies` in its rockspec file then it won't work. +[luarocks2nix](https://github.com/nix-community/luarocks) is a tool capable of generating nix derivations from both rockspec and src.rock (and favors the src.rock). +The automation only goes so far though and some packages need to be customized. +These customizations go in `pkgs/development/lua-modules/overrides.nix`. +For instance if the rockspec defines `external_dependencies`, these need to be manually added in in its rockspec file then it won't work. -You can run `nix-shell -p luarocks-nix` and then `luarocks nix PKG_NAME`. +You can try converting luarocks packages to nix packages with the command `nix-shell -p luarocks-nix` and then `luarocks nix PKG_NAME`. Nix rely on luarocks to install lua packages, basically it runs: `luarocks make --deps-mode=none --tree $out` @@ -149,22 +149,23 @@ within a `toLuaModule` call, for instance mynewlib = toLuaModule ( stdenv.mkDerivation { ... }); ``` - +There is also the `buildLuaPackage` function that can be used when lua modules +are not packaged for luarocks. You can see a few examples at `pkgs/top-level/lua-packages.nix`. ## Lua Reference ### Lua interpreters Versions 5.1, 5.2 and 5.3 of the lua interpreter are available as -respectively `lua_51`, `lua_52` and `lua_53`. The luajit interpreter is also available. -The Nix expressions for the interpreters can be found in `pkgs/development/interpreters/lua`. +respectively `lua_51`, `lua_52` and `lua_53`. Luajit is available too. +The Nix expressions for the interpreters can be found in `pkgs/development/interpreters/lua-5`. #### Attributes on lua interpreters packages Each interpreter has the following attributes: -- `interpreter`. Alias for `${lua}/bin/lua`. +- `interpreter`. Alias for `${pkgs.lua}/bin/lua`. - `buildEnv`. Function to build lua interpreter environments with extra packages bundled together. See section *lua.buildEnv function* for usage and documentation. - `withPackages`. Simpler interface to `buildEnv`. - `pkgs`. Set of Lua packages for that specific interpreter. The package set can be modified by overriding the interpreter and passing `packageOverrides`. @@ -175,36 +176,32 @@ Each interpreter has the following attributes: The `buildLuarocksPackage` function is implemented in `pkgs/development/interpreters/lua-5/build-lua-package.nix` The following is an example: ```nix -luaexpat = buildLuarocksPackage rec { - pname = "luaexpat"; - version = "1.3.0-1"; +luaposix = buildLuarocksPackage { + pname = "luaposix"; + version = "34.0.4-1"; src = fetchurl { - url = https://luarocks.org/luaexpat-1.3.0-1.src.rock; - sha256 = "15jqz5q12i9zvjyagzwz2lrpzya64mih8v1hxwr0wl2gsjh86y5a"; + url = "https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luaposix-34.0.4-1.src.rock"; + sha256 = "0yrm5cn2iyd0zjd4liyj27srphvy0gjrjx572swar6zqr4dwjqp2"; }; - disabled = luaOlder "5.1"; - - propagatedBuildInputs = [ lua ]; - - buildType="builtin"; - - meta = { - homepage = http://www.keplerproject.org/luaexpat/; - description="XML Expat parsing"; - license = { - fullName = "MIT/X11"; - }; + disabled = (luaOlder "5.1") || (luaAtLeast "5.4"); + propagatedBuildInputs = [ bit32 lua std_normalize ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/luaposix/luaposix/"; + description = "Lua bindings for POSIX"; + maintainers = with maintainers; [ vyp lblasc ]; + license.fullName = "MIT/X11"; }; }; ``` The `buildLuarocksPackage` delegates most tasks to luarocks: -* it adds `luarocks` as an unpacker for `src.rock` files (in fact zip files) +* it adds `luarocks` as an unpacker for `src.rock` files (zip files really). * configurePhase` writes a temporary luarocks configuration file which location is exported via the environment variable `LUAROCKS_CONFIG`. -* In the `buildPhase`, nothing is done. +* the `buildPhase` does nothing. * `installPhase` calls `luarocks make --deps-mode=none --tree $out` to build and install the package * In the `postFixup` phase, the `wrapLuaPrograms` bash function is called to @@ -212,8 +209,7 @@ install the package environment variable and add dependent libraries to script's `LUA_PATH` and `LUA_CPATH`. -By default `meta.platforms` is set to the same value -as the interpreter unless overridden otherwise. +By default `meta.platforms` is set to the same value as the interpreter unless overridden otherwise. #### `buildLuaApplication` function @@ -232,19 +228,19 @@ lua.withPackages (ps: [ps.luafilesystem]) ``` `withPackages` passes the correct package set for the specific interpreter version as an argument to the function. In the above example, `ps` equals `luaPackages`. -But you can also easily switch to using lua_52: +But you can also easily switch to using `lua5_2`: ```nix with import {}; -lua_52.withPackages (ps: [ps.lua]) +lua5_2.withPackages (ps: [ps.lua]) ``` -Now, `ps` is set to `lua_52Packages`, matching the version of the interpreter. +Now, `ps` is set to `lua52Packages`, matching the version of the interpreter. ### Possible Todos -* export/use version specific variables such as LUA_PATH_5_2/LUAROCKS_CONFIG_5_2 +* export/use version specific variables such as `LUA_PATH_5_2`/`LUAROCKS_CONFIG_5_2` * let luarocks check for dependencies via exporting the different rocktrees in temporary config ### Lua Contributing guidelines @@ -252,5 +248,5 @@ Now, `ps` is set to `lua_52Packages`, matching the version of the interpreter. Following rules should be respected: * Make sure libraries build for all Lua interpreters. -* Commit names of Lua libraries should reflect that they are Lua libraries, so write for example `lua.luafilesystem: 1.11 -> 1.12`. +* Commit names of Lua libraries should reflect that they are Lua libraries, so write for example `luaPackages.luafilesystem: 1.11 -> 1.12`. diff --git a/doc/languages-frameworks/lua.xml b/doc/languages-frameworks/lua.xml deleted file mode 100644 index bcca6b737539..000000000000 --- a/doc/languages-frameworks/lua.xml +++ /dev/null @@ -1,36 +0,0 @@ -
- Lua - - - Lua packages are built by the buildLuaPackage function. This function is implemented in pkgs/development/lua-modules/generic/default.nix and works similarly to buildPerlPackage. (See for details.) - - - - Lua packages are defined in pkgs/top-level/lua-packages.nix. Most of them are simple. For example: - -fileSystem = buildLuaPackage { - name = "filesystem-1.6.2"; - src = fetchurl { - url = "https://github.com/keplerproject/luafilesystem/archive/v1_6_2.tar.gz"; - sha256 = "1n8qdwa20ypbrny99vhkmx8q04zd2jjycdb5196xdhgvqzk10abz"; - }; - meta = { - homepage = "https://github.com/keplerproject/luafilesystem"; - hydraPlatforms = stdenv.lib.platforms.linux; - maintainers = with maintainers; [ flosse ]; - }; -}; - - - - - Though, more complicated package should be placed in a seperate file in pkgs/development/lua-modules. - - - - Lua packages accept additional parameter disabled, which defines the condition of disabling package from luaPackages. For example, if package has disabled assigned to lua.luaversion != "5.1", it will not be included in any luaPackages except lua51Packages, making it only be built for lua 5.1. - -
-- cgit 1.4.1 From 8d05c66dc66dcffcc1c15289cfef2dc4d122911f Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sun, 7 Jun 2020 20:12:56 +0200 Subject: fixup! update --- doc/languages-frameworks/lua.section.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/languages-frameworks/lua.section.md b/doc/languages-frameworks/lua.section.md index 058b8f45c988..a0e9917b8ec5 100644 --- a/doc/languages-frameworks/lua.section.md +++ b/doc/languages-frameworks/lua.section.md @@ -11,7 +11,7 @@ date: 2019-02-05 ### Overview of Lua Several versions of the Lua interpreter are available: luajit, lua 5.1, 5.2, 5.3. -The attribute `lua` refers to the default interpreter, it is also possible to refer to specific versions, e.g. `lua_52` refers to Lua 5.2. +The attribute `lua` refers to the default interpreter, it is also possible to refer to specific versions, e.g. `lua5_2` refers to Lua 5.2. Lua libraries are in separate sets, with one set per interpreter version. @@ -48,7 +48,7 @@ using `config.nix`, { # ... packageOverrides = pkgs: with pkgs; { - myLuaEnv = lua_52.withPackages (ps: with ps; [ busted luafilesystem ]); + myLuaEnv = lua5_2.withPackages (ps: with ps; [ busted luafilesystem ]); }; } ``` @@ -157,7 +157,7 @@ are not packaged for luarocks. You can see a few examples at `pkgs/top-level/lua ### Lua interpreters Versions 5.1, 5.2 and 5.3 of the lua interpreter are available as -respectively `lua_51`, `lua_52` and `lua_53`. Luajit is available too. +respectively `lua5_1`, `lua5_2` and `lua5_3`. Luajit is available too. The Nix expressions for the interpreters can be found in `pkgs/development/interpreters/lua-5`. -- cgit 1.4.1