Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 029a5de08390
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0a146054bdf6
Choose a head ref

Commits on Mar 23, 2020

  1. bintools: only add macos flags when targeting macOS

    We can’t set this for cross-compiling since we use the GNU linker.
    Instead, set these flags only when targetPlatform is macOS.
    
    Fixes #80754
    
    Fixes #83141
    matthewbauer committed Mar 23, 2020
    Copy the full SHA
    b0b0a06 View commit details

Commits on Apr 1, 2020

  1. kernel: fix config generation

    Addresses NixOS/nixpkgs#71803:
    Kernel options are not merged as described, especially the "optional"
    aspects. The error silences legitimate warnings.
    teto committed Apr 1, 2020
    Copy the full SHA
    b9a4e69 View commit details
  2. kernel: fix errors in configuration

    With the fix in kernel configuration merging, some kernel configuration items
    marked as mandatory now correctly trigger an error when unused (while they
    previously were unused).
    teto committed Apr 1, 2020
    Copy the full SHA
    121b17e View commit details

Commits on Apr 11, 2020

  1. Copy the full SHA
    bc6b37e View commit details

Commits on Apr 24, 2020

  1. Copy the full SHA
    c09ffc7 View commit details
  2. Copy the full SHA
    f20fd89 View commit details
  3. nixos/system-path: add zstd

    prusnak committed Apr 24, 2020
    Copy the full SHA
    8a67595 View commit details
  4. Copy the full SHA
    99f4ca8 View commit details

Commits on Apr 29, 2020

  1. nixos-artwork: add file path attributes

    This makes things so much easier, and we install to
    the path that both gnome-backgrounds and
    elementary-wallpapers install to.
    worldofpeace committed Apr 29, 2020
    Copy the full SHA
    62587f4 View commit details
  2. Copy the full SHA
    3d1706c View commit details
  3. Copy the full SHA
    7f3bc5b View commit details
  4. nixos/pantheon: install nixos wallpaper

    Fixes  #86146
    worldofpeace committed Apr 29, 2020
    Copy the full SHA
    5100e4f View commit details

Commits on May 9, 2020

  1. Copy the full SHA
    ddd2b69 View commit details

Commits on May 10, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a3dc89a View commit details
  2. serd: 0.30.2 -> 0.30.4

    r-ryantm committed May 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b52a5c2 View commit details
  3. libv4l: 1.18.0 -> 1.18.1

    r-ryantm committed May 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ec7e931 View commit details
  4. vim: 8.2.0510 -> 8.2.0701

    r-ryantm committed May 10, 2020
    Copy the full SHA
    1ad8565 View commit details

Commits on May 11, 2020

  1. Copy the full SHA
    23ce1ee View commit details

Commits on May 12, 2020

  1. *-wrapper; Switch from infixSalt to suffixSalt

    I hate the thing too even though I made it, and rather just get rid of
    it. But we can't do that yet. In the meantime, this brings us more
    inline with autoconf and will make it slightly easier for me to write a
    pkg-config wrapper, which we need.
    Ericson2314 authored and John Cotton Ericson committed May 12, 2020
    Copy the full SHA
    1ac5398 View commit details
  2. qt5: Add missing include path to pkg-config files

    This is achieved by patching qtbase `qmake/generators/makefile.cpp` to
    unconditionally add the missing `-I${includedir}`. The include path is
    otherwise conditioned on whether it is already available or not. Since there is
    no unified set of system include paths in nix this cause problems as reported
    in #52457.
    xbreak committed May 12, 2020
    Copy the full SHA
    ee59753 View commit details
  3. blueman 2.1.2 -> 2.1.3

    dasj19 committed May 12, 2020
    Copy the full SHA
    3502f2a View commit details
  4. kexectools: always pass host and target to configure

    Fixes #56290.
    Gaelan committed May 12, 2020
    Copy the full SHA
    b6beb43 View commit details
  5. Copy the full SHA
    b9a81f7 View commit details
  6. Merge pull request #86166 from Ericson2314/suffix-salt

    *-wrapper; Switch from `infixSalt` to `suffixSalt`
    Ericson2314 authored May 12, 2020
    Copy the full SHA
    a0c003e View commit details

Commits on May 13, 2020

  1. Revert "Revert "libbfd: fix build""

    This reverts commit 237ef30.
    
    Looks like we're trying to bump binutils again?
    Ericson2314 committed May 13, 2020
    Copy the full SHA
    c10f0a3 View commit details
  2. Merge pull request #83180 from matthewbauer/only-add-ldflags-for-macos

    bintools: only add macos flags when targeting macOS
    matthewbauer authored May 13, 2020
    Copy the full SHA
    d38bad5 View commit details
  3. wavpack: 5.2.0 -> 5.3.0

    r-ryantm authored and Jon committed May 13, 2020
    Copy the full SHA
    58d0719 View commit details
  4. sysstat: 12.3.1 -> 12.3.2

    r-ryantm authored and Jon committed May 13, 2020
    Copy the full SHA
    ee2922a View commit details
  5. go: stop setting GOPATH

    The compiler does not need it anymore, has not needed it for many years
    iirc. This just goes in and pollutes the environment overriding the
    users GOPATH and causing grief.
    
    Go even warns about it itself, without vs with this commit:
    
    ```sh
    ~> go env GOPATH
    /home/manny/go
    ~> nix-shell -p go
    ~> go env GOPATH
    warning: GOPATH set to GOROOT (/nix/store/gvw1mfpdrk7i82884yhxf9lf5j3c12zm-go-1.14.1/share/go) has no effect
    /nix/store/gvw1mfpdrk7i82884yhxf9lf5j3c12zm-go-1.14.1/share/go
    ~> exit
    ~> nix-shell -I nixpkgs=cloned/NixOS/nixpkgs -p go
    ~> go env GOPATH
    /home/manny/go
    ~> exit
    ```
    mmlb authored and Mic92 committed May 13, 2020
    Copy the full SHA
    a1e13f6 View commit details

Commits on May 14, 2020

  1. Merge staging-next into staging

    FRidh committed May 14, 2020
    Copy the full SHA
    404fe35 View commit details
  2. nss: fix building for aarch32 on aarch64

    There are two ways to build a package for aarch32 on an aarch64 machine:
    either by cross compiling as normal, or by adding armv6l/armv7l to
    extraPlatforms and doing a non-cross compile.
    
    Previously, NSS failed to build with both methods: when using
    extraPlatforms, things failed because NSS includes an armv8-specific
    file (presumably based on the result of uname); when cross compiling,
    NSS's build system expects to receive an architecture name of arm (not
    armv6l or whatever), so was failing to include some arch-specific code
    and failed with a linker error.
    
    This commit fixes those things by a) always passing the arch, even when
    not cross-compiling, and b) special-casing aarch32 to always pass in an
    arch of arm.
    Gaelan committed May 14, 2020
    Copy the full SHA
    b14d997 View commit details
  3. Merge pull request #87748 from Gaelan/nss-arm-fix

    nss: fix building for aarch32 on aarch64
    andir authored May 14, 2020
    Copy the full SHA
    bf60834 View commit details
  4. Copy the full SHA
    8d41f9f View commit details

Commits on May 15, 2020

  1. Copy the full SHA
    e7d4b31 View commit details
  2. Copy the full SHA
    c1983f7 View commit details
  3. Copy the full SHA
    282cb2f View commit details
  4. gobject-introspection: clean up the expression

    * format with nixpkgs-fmt
    * reorder the attributes
    * use pkg-config instead of the pkgconfig alias
    * optional → optionals
    * remove top-level `with lib;`
    jtojnar committed May 15, 2020
    Copy the full SHA
    1bc7b68 View commit details
  5. gobject-introspection: more clean-ups

    * remove glibcLocales now that glibc contains C.UTF-8
    * remove libintl, that should be in by default or something
    * update homepage
    * add gnome team to maintainers
    * remove the temporary libregress closer its creation
    jtojnar committed May 15, 2020
    Copy the full SHA
    fbb86b1 View commit details
  6. gobject-introspection: consolidate patches

    and add comments
    jtojnar committed May 15, 2020
    Copy the full SHA
    e4a009a View commit details
  7. Copy the full SHA
    fd5ea9d View commit details
  8. Merge pull request #87583 from Gaelan/single-llvm

    stdenv-darwin: now with 50% less LLVM!
    matthewbauer authored May 15, 2020
    Copy the full SHA
    fb35227 View commit details

Commits on May 16, 2020

  1. Copy the full SHA
    27edd9e View commit details
  2. Copy the full SHA
    ee8cfe4 View commit details
  3. pkg-config-wrapper: Init

    This fixes longstanding build issues
    Ericson2314 committed May 16, 2020
    Copy the full SHA
    c71ab32 View commit details
  4. Copy the full SHA
    75c55c4 View commit details
  5. Copy the full SHA
    78987e2 View commit details
  6. Merge pull request #87968 from elohmeier/ffmpeg-addOpenGLRunpath2

    ffmpeg: extend addOpenGLRunpath to handle libcuda referencing libraries
    flokli authored May 16, 2020
    Copy the full SHA
    a42e336 View commit details

Commits on May 17, 2020

  1. Copy the full SHA
    c9857de View commit details

Commits on May 18, 2020

  1. Merge pull request #87891 from Izorkin/connector-c

    mariadb-connector-c: 3.1.7 -> 3.1.8
    flokli authored May 18, 2020
    Copy the full SHA
    682b7c2 View commit details
  2. git: Add a doc output for the HTML and text files

    This will install the HTML and text documentation into a separate output
    so that users can install it without having to rebuild Git.
    Previously only `doc/git/git-subtree.html` was installed (which is now
    in $doc as well).
    The current output sizes are as follows:
    ```
    $ du -sh $(nix-build -A git)
    47M     /nix/store/wyqgalp61kmavx06rams7z8jz177nd8y-git-2.26.2
    $ du -sh $(nix-build -A git.doc)
    14M     /nix/store/6zi22fl5xc3sg23d9shsviinvwk89wvq-git-2.26.2-doc
    ```
    
    Fixes #86022 (at least partly since the output has to be installed).
    primeos committed May 18, 2020
    Copy the full SHA
    54918d6 View commit details
Showing 856 changed files with 12,361 additions and 15,723 deletions.
2 changes: 1 addition & 1 deletion doc/languages-frameworks/index.xml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
<xi:include href="idris.section.xml" />
<xi:include href="ios.section.xml" />
<xi:include href="java.xml" />
<xi:include href="lua.xml" />
<xi:include href="lua.section.xml" />
<xi:include href="node.section.xml" />
<xi:include href="ocaml.xml" />
<xi:include href="perl.xml" />
252 changes: 252 additions & 0 deletions doc/languages-frameworks/lua.section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
---
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, 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. `lua5_2` 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 `lua5_2.pkgs.busted`.
The main package set contains aliases to these package sets, e.g.
`luaPackages` refers to `lua5_1.pkgs` and `lua52Packages` to
`lua5_2.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 <nixpkgs> {};
lua5_2.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 = lua5_2.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 ]))
];
}
```

### How to override a Lua package using overlays?

Use the following overlay template:

```nix
final: prev:
{
lua = prev.lua.override {
packageOverrides = luaself: luaprev: {
luarocks-nix = luaprev.luarocks-nix.overrideAttrs(oa: {
pname = "luarocks-nix";
src = /home/my_luarocks/repository;
});
};
luaPackages = lua.pkgs;
}
```

### Temporary Lua environment with `nix-shell`


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](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/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 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`

#### 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 { ... });
```

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 `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`.


#### Attributes on lua interpreters packages

Each interpreter has the following attributes:

- `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`.


#### `buildLuarocksPackage` function

The `buildLuarocksPackage` function is implemented in `pkgs/development/interpreters/lua-5/build-lua-package.nix`
The following is an example:
```nix
luaposix = buildLuarocksPackage {
pname = "luaposix";
version = "34.0.4-1";
src = fetchurl {
url = "https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luaposix-34.0.4-1.src.rock";
sha256 = "0yrm5cn2iyd0zjd4liyj27srphvy0gjrjx572swar6zqr4dwjqp2";
};
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 (zip files really).
* configurePhase` writes a temporary luarocks configuration file which location
is exported via the environment variable `LUAROCKS_CONFIG`.
* 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
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` 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 <nixpkgs> {};
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 `lua5_2`:
```nix
with import <nixpkgs> {};
lua5_2.withPackages (ps: [ps.lua])
```

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`
* 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 `luaPackages.luafilesystem: 1.11 -> 1.12`.

36 changes: 0 additions & 36 deletions doc/languages-frameworks/lua.xml

This file was deleted.

2 changes: 1 addition & 1 deletion doc/using/configuration.xml
Original file line number Diff line number Diff line change
@@ -387,7 +387,7 @@ fi
</screen>

<para>
Now just run <literal>source $HOME/.profile</literal> and you can starting loading man pages from your environent.
Now just run <literal>source $HOME/.profile</literal> and you can starting loading man pages from your environment.
</para>
</section>

2 changes: 0 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Experimental flake interface to Nixpkgs.
# See https://github.com/NixOS/rfcs/pull/49 for details.
{
edition = 201909;

description = "A collection of packages for the Nix package manager";

outputs = { self }:
8 changes: 4 additions & 4 deletions lib/kernel.nix
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@ with lib;
option = x:
x // { optional = true; };

yes = { tristate = "y"; };
no = { tristate = "n"; };
module = { tristate = "m"; };
freeform = x: { freeform = x; };
yes = { tristate = "y"; optional = false; };
no = { tristate = "n"; optional = false; };
module = { tristate = "m"; optional = false; };
freeform = x: { freeform = x; optional = false; };

/*
Common patterns/legacy used in common-config/hardened/config.nix
5 changes: 5 additions & 0 deletions lib/licenses.nix
Original file line number Diff line number Diff line change
@@ -276,6 +276,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) {
fullName = "European Union Public License 1.2";
};

fdl11 = spdx {
spdxId = "GFDL-1.1-only";
fullName = "GNU Free Documentation License v1.1 only";
};

fdl12 = spdx {
spdxId = "GFDL-1.2-only";
fullName = "GNU Free Documentation License v1.2 only";
18 changes: 18 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
@@ -3514,6 +3514,12 @@
githubId = 1608697;
name = "Jens Binkert";
};
jeremyschlatter = {
email = "github@jeremyschlatter.com";
github = "jeremyschlatter";
githubId = 5741620;
name = "Jeremy Schlatter";
};
jerith666 = {
email = "github@matt.mchenryfamily.org";
github = "jerith666";
@@ -5027,6 +5033,12 @@
githubId = 223323;
name = "Miguel de la Cruz";
};
mgdm = {
email = "michael@mgdm.net";
github = "mgdm";
githubId = 71893;
name = "Michael Maclean";
};
mgregoire = {
email = "gregoire@martinache.net";
github = "M-Gregoire";
@@ -5154,6 +5166,12 @@
fingerprint = "3196 83D3 9A1B 4DE1 3DC2 51FD FEA8 88C9 F5D6 4F62";
}];
};
mir06 = {
email = "armin.leuprecht@uni-graz.at";
github = "mir06";
githubId = 8479244;
name = "Armin Leuprecht";
};
mirdhyn = {
email = "mirdhyn@gmail.com";
github = "mirdhyn";
Loading