Skip to content
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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 75da00cacdb2
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ecda7a86e7ff
Choose a head ref

Commits on Dec 27, 2020

  1. icu68: init at 68.2

    marsam committed Dec 27, 2020
    Copy the full SHA
    947e443 View commit details
  2. icu: 67.1 -> 68.2

    marsam committed Dec 27, 2020
    Copy the full SHA
    c0b3169 View commit details

Commits on Jan 12, 2021

  1. linux: enable display core support for all amd gpus

    newer amd gpus require display core to function normally
    wakira authored and github-actions[bot] committed Jan 12, 2021
    Copy the full SHA
    57c9a0d View commit details

Commits on Jan 19, 2021

  1. libpcap: 1.9.1 -> 1.10.0

    r-ryantm committed Jan 19, 2021
    Copy the full SHA
    e09aa04 View commit details

Commits on Jan 24, 2021

  1. Copy the full SHA
    3ebc1b5 View commit details

Commits on Jan 29, 2021

  1. glibc: 2.32-35 -> 2.32-37

    TredwellGit committed Jan 29, 2021
    Copy the full SHA
    1ef3b90 View commit details
  2. hwdata: 0.335 -> 0.343

    r-ryantm authored and mweinelt committed Jan 29, 2021
    Copy the full SHA
    84f357e View commit details
  3. help2man: 1.47.16 -> 1.47.17

    r-ryantm committed Jan 29, 2021
    Copy the full SHA
    6e437a6 View commit details

Commits on Jan 30, 2021

  1. Copy the full SHA
    455ea0d View commit details

Commits on Jan 31, 2021

  1. libuv: disable tcp_connect_timeout test

    The test relies on connection to 8.8.8.8 port 9999 to hang.
    
    In sandboxed build it is skipped anyway:
    
    ok 270 - tcp_connect_timeout # SKIP Network unreachable.
    veprbl committed Jan 31, 2021
    Copy the full SHA
    0b214e0 View commit details
  2. Copy the full SHA
    278843e View commit details

Commits on Feb 3, 2021

  1. systemd: 247.2 -> 247.3

    flokli committed Feb 3, 2021
    Copy the full SHA
    49cb525 View commit details
  2. systemd: nixpkgs-fmt

    This was recently introduced, and apparently not nixpkgs-fmt'ed.
    
    While there's no global consensus on nixpkgs-fmt'ing everything,
    indenting this by 2 more spaces won't hurt.
    flokli committed Feb 3, 2021
    Copy the full SHA
    f61a3bf View commit details
  3. Copy the full SHA
    2a19c18 View commit details
  4. Revert "nixos/network-interfaces-systemd: fix IPv6 privacy extensions"

    This reverts commit d349582.
    
    The workaround initially applied isn't necessary anymore, as 247.3
    contains the following commit:
    
    > 242fc1d261 network: fix IPv6PrivacyExtensions=kernel handling
    
    … which fixes systemd/systemd#18003.
    flokli committed Feb 3, 2021
    Copy the full SHA
    24bebfa View commit details

Commits on Feb 4, 2021

  1. Copy the full SHA
    e63d450 View commit details
  2. dnsmasq: 2.83 -> 2.84

    r-ryantm committed Feb 4, 2021
    Copy the full SHA
    0d4e6f5 View commit details
  3. e2tools: 0.0.16 -> 0.1.0

    repository moved to GitHub, website changed as well
    armijnhemel committed Feb 4, 2021
    Copy the full SHA
    ccf3d01 View commit details
  4. Copy the full SHA
    76dca5f View commit details
  5. Copy the full SHA
    b59fcde View commit details
  6. kdepim-apps-libs: remove

    ttuegel committed Feb 4, 2021
    Copy the full SHA
    ab5e65b View commit details
  7. Copy the full SHA
    828b91c View commit details
  8. Copy the full SHA
    e2e0b52 View commit details
  9. Copy the full SHA
    ff7b81e View commit details
  10. Copy the full SHA
    fc27c09 View commit details
  11. Copy the full SHA
    450caa6 View commit details
  12. akonadi: update patches

    ttuegel committed Feb 4, 2021
    Copy the full SHA
    ce5601d View commit details
  13. rinutils: init at 0.8.0

    ttuegel committed Feb 4, 2021
    Copy the full SHA
    500eb30 View commit details

Commits on Feb 5, 2021

  1. Copy the full SHA
    446405c View commit details
  2. Copy the full SHA
    a5f5d5b View commit details
  3. krdc: broken with Qt < 5.14

    ttuegel committed Feb 5, 2021
    Copy the full SHA
    99a4ecf View commit details
  4. akonadi: add lzma input

    ttuegel committed Feb 5, 2021
    Copy the full SHA
    661affb View commit details
  5. Copy the full SHA
    6a3b909 View commit details
  6. Copy the full SHA
    cf1dc01 View commit details
  7. Copy the full SHA
    18807a9 View commit details
  8. Copy the full SHA
    2a19def View commit details
  9. Copy the full SHA
    71dd477 View commit details
  10. Copy the full SHA
    d068ac8 View commit details
  11. Copy the full SHA
    8c22f6b View commit details
  12. kalarm: add kidletime input

    ttuegel committed Feb 5, 2021
    Copy the full SHA
    5e55c70 View commit details
  13. Copy the full SHA
    6546690 View commit details

Commits on Feb 6, 2021

  1. Copy the full SHA
    bbdb4e6 View commit details
  2. Copy the full SHA
    67c2a70 View commit details
  3. Copy the full SHA
    80b3837 View commit details
  4. livepeer: 0.5.13 -> 0.5.14

    r-ryantm committed Feb 6, 2021
    Copy the full SHA
    e4b065e View commit details
  5. lxd: 4.10 -> 4.11

    r-ryantm committed Feb 6, 2021
    Copy the full SHA
    83eb14b View commit details
  6. Copy the full SHA
    44bcd67 View commit details
  7. mednaffe: 0.9.0 -> 0.9.1

    r-ryantm committed Feb 6, 2021
    Copy the full SHA
    f94c9dd View commit details
  8. Merge pull request #112156 from r-ryantm/auto-update/mednaffe

    mednaffe: 0.9.0 -> 0.9.1
    AndersonTorres authored Feb 6, 2021
    Copy the full SHA
    84ddd2c View commit details
  9. Merge pull request #112153 from r-ryantm/auto-update/lxd

    lxd: 4.10 -> 4.11
    marsam authored Feb 6, 2021
    Copy the full SHA
    5590e8f View commit details
Showing 590 changed files with 4,167 additions and 2,556 deletions.
2 changes: 1 addition & 1 deletion doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
@@ -611,7 +611,7 @@ Using the example above, the analagous pytestCheckHook usage would be:
"update"
];
disabledTestFiles = [
disabledTestPaths = [
"tests/test_failing.py"
];
```
194 changes: 193 additions & 1 deletion doc/languages-frameworks/rust.section.md
Original file line number Diff line number Diff line change
@@ -223,7 +223,7 @@ sometimes it may be necessary to disable this so the tests run consecutively.
```nix
rustPlatform.buildRustPackage {
/* ... */
cargoParallelTestThreads = false;
dontUseCargoParallelTests = true;
}
```

@@ -264,6 +264,198 @@ rustPlatform.buildRustPackage rec {
}
```

## Compiling non-Rust packages that include Rust code

Several non-Rust packages incorporate Rust code for performance- or
security-sensitive parts. `rustPlatform` exposes several functions and
hooks that can be used to integrate Cargo in non-Rust packages.

### Vendoring of dependencies

Since network access is not allowed in sandboxed builds, Rust crate
dependencies need to be retrieved using a fetcher. `rustPlatform`
provides the `fetchCargoTarball` fetcher, which vendors all
dependencies of a crate. For example, given a source path `src`
containing `Cargo.toml` and `Cargo.lock`, `fetchCargoTarball`
can be used as follows:

```nix
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
hash = "sha256-BoHIN/519Top1NUBjpB/oEMqi86Omt3zTQcXFWqrek0=";
};
```

The `src` attribute is required, as well as a hash specified through
one of the `sha256` or `hash` attributes. The following optional
attributes can also be used:

* `name`: the name that is used for the dependencies tarball. If
`name` is not specified, then the name `cargo-deps` will be used.
* `sourceRoot`: when the `Cargo.lock`/`Cargo.toml` are in a
subdirectory, `sourceRoot` specifies the relative path to these
files.
* `patches`: patches to apply before vendoring. This is useful when
the `Cargo.lock`/`Cargo.toml` files need to be patched before
vendoring.

### Hooks

`rustPlatform` provides the following hooks to automate Cargo builds:

* `cargoSetupHook`: configure Cargo to use depenencies vendored
through `fetchCargoTarball`. This hook uses the `cargoDeps`
environment variable to find the vendored dependencies. If a project
already vendors its dependencies, the variable `cargoVendorDir` can
be used instead. When the `Cargo.toml`/`Cargo.lock` files are not in
`sourceRoot`, then the optional `cargoRoot` is used to specify the
Cargo root directory relative to `sourceRoot`.
* `cargoBuildHook`: use Cargo to build a crate. If the crate to be
built is a crate in e.g. a Cargo workspace, the relative path to the
crate to build can be set through the optional `buildAndTestSubdir`
environment variable. Additional Cargo build flags can be passed
through `cargoBuildFlags`.
* `maturinBuildHook`: use [Maturin](https://github.com/PyO3/maturin)
to build a Python wheel. Similar to `cargoBuildHook`, the optional
variable `buildAndTestSubdir` can be used to build a crate in a
Cargo workspace. Additional maturin flags can be passed through
`maturinBuildFlags`.
* `cargoCheckHook`: run tests using Cargo. Additional flags can be
passed to Cargo using `checkFlags` and `checkFlagsArray`. By
default, tests are run in parallel. This can be disabled by setting
`dontUseCargoParallelTests`.
* `cargoInstallHook`: install binaries and static/shared libraries
that were built using `cargoBuildHook`.

### Examples

#### Python package using `setuptools-rust`

For Python packages using `setuptools-rust`, you can use
`fetchCargoTarball` and `cargoSetupHook` to retrieve and set up Cargo
dependencies. The build itself is then performed by
`buildPythonPackage`.

The following example outlines how the `tokenizers` Python package is
built. Since the Python package is in the `source/bindings/python`
directory of the *tokenizers* project's source archive, we use
`sourceRoot` to point the tooling to this directory:

```nix
{ fetchFromGitHub
, buildPythonPackage
, rustPlatform
, setuptools-rust
}:
buildPythonPackage rec {
pname = "tokenizers";
version = "0.10.0";
src = fetchFromGitHub {
owner = "huggingface";
repo = pname;
rev = "python-v${version}";
hash = "sha256-rQ2hRV52naEf6PvRsWVCTN7B1oXAQGmnpJw4iIdhamw=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src sourceRoot;
name = "${pname}-${version}";
hash = "sha256-BoHIN/519Top1NUBjpB/oEMqi86Omt3zTQcXFWqrek0=";
};
sourceRoot = "source/bindings/python";
nativeBuildInputs = [ setuptools-rust ] ++ (with rustPlatform; [
cargoSetupHook
rust.cargo
rust.rustc
]);
# ...
}
```

In some projects, the Rust crate is not in the main Python source
directory. In such cases, the `cargoRoot` attribute can be used to
specify the crate's directory relative to `sourceRoot`. In the
following example, the crate is in `src/rust`, as specified in the
`cargoRoot` attribute. Note that we also need to specify the correct
path for `fetchCargoTarball`.

```nix
{ buildPythonPackage
, fetchPypi
, rustPlatform
, setuptools-rust
, openssl
}:
buildPythonPackage rec {
pname = "cryptography";
version = "3.4.2"; # Also update the hash in vectors.nix
src = fetchPypi {
inherit pname version;
sha256 = "1i1mx5y9hkyfi9jrrkcw804hmkcglxi6rmf7vin7jfnbr2bf4q64";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
sourceRoot = "${pname}-${version}/${cargoRoot}";
name = "${pname}-${version}";
hash = "sha256-PS562W4L1NimqDV2H0jl5vYhL08H9est/pbIxSdYVfo=";
};
cargoRoot = "src/rust";
# ...
}
```

#### Python package using `maturin`

Python packages that use [Maturin](https://github.com/PyO3/maturin)
can be built with `fetchCargoTarball`, `cargoSetupHook`, and
`maturinBuildHook`. For example, the following (partial) derivation
builds the `retworkx` Python package. `fetchCargoTarball` and
`cargoSetupHook` are used to fetch and set up the crate dependencies.
`maturinBuildHook` is used to perform the build.

```nix
{ lib
, buildPythonPackage
, rustPlatform
, fetchFromGitHub
}:
buildPythonPackage rec {
pname = "retworkx";
version = "0.6.0";
src = fetchFromGitHub {
owner = "Qiskit";
repo = "retworkx";
rev = version;
sha256 = "11n30ldg3y3y6qxg3hbj837pnbwjkqw3nxq6frds647mmmprrd20";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-heOBK8qi2nuc/Ib+I/vLzZ1fUUD/G/KTw9d7M4Hz5O0=";
};
format = "pyproject";
nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];
# ...
}
```

## Compiling Rust crates using Nix instead of Cargo

### Simple operation
4 changes: 2 additions & 2 deletions lib/licenses.nix
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ let

in

lib.mapAttrs (n: v: v // { shortName = n; }) {
lib.mapAttrs (n: v: v // { shortName = n; }) ({
/* License identifiers from spdx.org where possible.
* If you cannot find your license here, then look for a similar license or
* add it to this list. The URL mentioned above is a good source for inspiration.
@@ -877,4 +877,4 @@ lib.mapAttrs (n: v: v // { shortName = n; }) {
fullName = "GNU Lesser General Public License v3.0";
deprecated = true;
};
}
})
3 changes: 2 additions & 1 deletion maintainers/scripts/nixpkgs-lint.nix
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@
stdenv.mkDerivation {
name = "nixpkgs-lint-1";

buildInputs = [ makeWrapper perl perlPackages.XMLSimple ];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl perlPackages.XMLSimple ];

dontUnpack = true;
buildPhase = "true";
12 changes: 1 addition & 11 deletions nixos/modules/tasks/network-interfaces-systemd.nix
Original file line number Diff line number Diff line change
@@ -93,17 +93,7 @@ in
(if i.useDHCP != null then i.useDHCP else false));
address = forEach (interfaceIps i)
(ip: "${ip.address}/${toString ip.prefixLength}");
# IPv6PrivacyExtensions=kernel seems to be broken with networkd.
# Instead of using IPv6PrivacyExtensions=kernel, configure it according to the value of
# `tempAddress`:
networkConfig.IPv6PrivacyExtensions = {
# generate temporary addresses and use them by default
"default" = true;
# generate temporary addresses but keep using the standard EUI-64 ones by default
"enabled" = "prefer-public";
# completely disable temporary addresses
"disabled" = false;
}.${i.tempAddress};
networkConfig.IPv6PrivacyExtensions = "kernel";
linkConfig = optionalAttrs (i.macAddress != null) {
MACAddress = i.macAddress;
} // optionalAttrs (i.mtu != null) {
18 changes: 15 additions & 3 deletions nixos/modules/virtualisation/qemu-vm.nix
Original file line number Diff line number Diff line change
@@ -277,6 +277,18 @@ in
'';
};

virtualisation.msize =
mkOption {
default = null;
type = types.nullOr types.ints.unsigned;
description =
''
msize (maximum packet size) option passed to 9p file systems, in
bytes. Increasing this should increase performance significantly,
at the cost of higher RAM usage.
'';
};

virtualisation.diskSize =
mkOption {
default = 512;
@@ -666,7 +678,7 @@ in
${if cfg.writableStore then "/nix/.ro-store" else "/nix/store"} =
{ device = "store";
fsType = "9p";
options = [ "trans=virtio" "version=9p2000.L" "cache=loose" ];
options = [ "trans=virtio" "version=9p2000.L" "cache=loose" ] ++ lib.optional (cfg.msize != null) "msize=${toString cfg.msize}";
neededForBoot = true;
};
"/tmp" = mkIf config.boot.tmpOnTmpfs
@@ -679,13 +691,13 @@ in
"/tmp/xchg" =
{ device = "xchg";
fsType = "9p";
options = [ "trans=virtio" "version=9p2000.L" ];
options = [ "trans=virtio" "version=9p2000.L" ] ++ lib.optional (cfg.msize != null) "msize=${toString cfg.msize}";
neededForBoot = true;
};
"/tmp/shared" =
{ device = "shared";
fsType = "9p";
options = [ "trans=virtio" "version=9p2000.L" ];
options = [ "trans=virtio" "version=9p2000.L" ] ++ lib.optional (cfg.msize != null) "msize=${toString cfg.msize}";
neededForBoot = true;
};
} // optionalAttrs (cfg.writableStore && cfg.writableStoreUseTmpfs)
16 changes: 15 additions & 1 deletion nixos/tests/unbound.nix
Original file line number Diff line number Diff line change
@@ -27,6 +27,9 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
# disable the root anchor update as we do not have internet access during
# the test execution
services.unbound.enableRootTrustAnchor = false;

# we want to test the full-variant of the package to also get DoH support
services.unbound.package = pkgs.unbound-full;
};
};

@@ -81,13 +84,16 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
networking.firewall.allowedTCPPorts = [
53 # regular DNS
853 # DNS over TLS
443 # DNS over HTTPS
];
networking.firewall.allowedUDPPorts = [ 53 ];

services.unbound = {
enable = true;
allowedAccess = [ "192.168.0.0/24" "fd21::/64" "::1" "127.0.0.0/8" ];
interfaces = [ "::1" "127.0.0.1" "192.168.0.2" "fd21::2" "192.168.0.2@853" "fd21::2@853" "::1@853" "127.0.0.1@853" ];
interfaces = [ "::1" "127.0.0.1" "192.168.0.2" "fd21::2"
"192.168.0.2@853" "fd21::2@853" "::1@853" "127.0.0.1@853"
"192.168.0.2@443" "fd21::2@443" "::1@443" "127.0.0.1@443" ];
forwardAddresses = [
(lib.head nodes.authoritative.config.networking.interfaces.eth1.ipv6.addresses).address
(lib.head nodes.authoritative.config.networking.interfaces.eth1.ipv4.addresses).address
@@ -217,6 +223,14 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
expected,
["+tcp", "+tls"] + args,
)
query(
machine,
remote,
query_type,
zone,
expected,
["+https"] + args,
)
client.start()
3 changes: 2 additions & 1 deletion pkgs/applications/audio/MMA/default.nix
Original file line number Diff line number Diff line change
@@ -9,7 +9,8 @@
sha256 = "18k0hwlqky5x4y461fxmw77gvz7z8jyrvxicrqphsgvwwinzy732";
};

buildInputs = [ makeWrapper python3 alsaUtils timidity ];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ python3 alsaUtils timidity ];

patchPhase = ''
sed -i 's@/usr/bin/aplaymidi@/${alsaUtils}/bin/aplaymidi@g' mma-splitrec
2 changes: 1 addition & 1 deletion pkgs/applications/audio/baudline/default.nix
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
else
throw "baudline isn't supported (yet?) on ${stdenv.hostPlatform.system}";

buildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeWrapper ];

# Prebuilt binary distribution.
# "patchelf --set-rpath" seems to break the application (cannot start), using
2 changes: 1 addition & 1 deletion pkgs/applications/audio/caudec/default.nix
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
patchShebangs ./install.sh
'';

buildInputs = [ bash makeWrapper ];
nativeBuildInputs = [ bash makeWrapper ];

installPhase = ''
./install.sh --prefix=$out/bin
Loading