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: e8ec91bb5954
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: bd05e877dc09
Choose a head ref
Loading
Showing 3,138 changed files with 85,033 additions and 43,796 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
18 changes: 9 additions & 9 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -46,17 +46,17 @@

# Python-related code and docs
/maintainers/scripts/update-python-libraries @FRidh
/pkgs/top-level/python-packages.nix @FRidh
/pkgs/development/interpreters/python @FRidh
/pkgs/development/python-modules @FRidh
/doc/languages-frameworks/python.md @FRidh
/pkgs/top-level/python-packages.nix @FRidh
/pkgs/development/interpreters/python @FRidh
/pkgs/development/python-modules @FRidh
/doc/languages-frameworks/python.md @FRidh

# Haskell
/pkgs/development/compilers/ghc @peti
/pkgs/development/haskell-modules @peti
/pkgs/development/haskell-modules/default.nix @peti
/pkgs/development/haskell-modules/generic-builder.nix @peti
/pkgs/development/haskell-modules/hoogle.nix @peti
/pkgs/development/compilers/ghc @peti @ryantm @basvandijk
/pkgs/development/haskell-modules @peti @ryantm @basvandijk
/pkgs/development/haskell-modules/default.nix @peti @ryantm @basvandijk
/pkgs/development/haskell-modules/generic-builder.nix @peti @ryantm @basvandijk
/pkgs/development/haskell-modules/hoogle.nix @peti @ryantm @basvandijk

# R
/pkgs/applications/science/math/R @peti
4 changes: 1 addition & 3 deletions doc/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
let
pkgs = import ./.. { };
lib = pkgs.lib;
sources = lib.sourceFilesBySuffices ./. [".xml"];
sources-langs = ./languages-frameworks;
in
pkgs.stdenv.mkDerivation {
name = "nixpkgs-manual";
@@ -16,7 +14,7 @@ pkgs.stdenv.mkDerivation {
# $ nix-shell --run "make clean all"
# otherwise they won't reapply :)
HIGHLIGHTJS = pkgs.documentation-highlighter;
XSL = "${pkgs.docbook5_xsl}/xml/xsl";
XSL = "${pkgs.docbook_xsl_ns}/xml/xsl";
RNG = "${pkgs.docbook5}/xml/rng/docbook/docbook.rng";
XMLFORMAT_CONFIG = ../nixos/doc/xmlformat.conf;
xsltFlags = lib.concatStringsSep " " [
24 changes: 22 additions & 2 deletions doc/functions.xml
Original file line number Diff line number Diff line change
@@ -649,6 +649,8 @@ merge:"diff3"
imageDigest = "sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b"; <co xml:id='ex-dockerTools-pullImage-2' />
finalImageTag = "1.11"; <co xml:id='ex-dockerTools-pullImage-3' />
sha256 = "0mqjy3zq2v6rrhizgb9nvhczl87lcfphq9601wcprdika2jz7qh8"; <co xml:id='ex-dockerTools-pullImage-4' />
os = "linux"; <co xml:id='ex-dockerTools-pullImage-5' />
arch = "x86_64"; <co xml:id='ex-dockerTools-pullImage-6' />
}
</programlisting>
</example>
@@ -664,9 +666,15 @@ merge:"diff3"
<callout arearefs='ex-dockerTools-pullImage-2'>
<para>
<varname>imageDigest</varname> specifies the digest of the image to be
downloaded. Skopeo can be used to get the digest of an image
downloaded. Skopeo can be used to get the digest of an image, with its
<varname>inspect</varname> subcommand. Since a given <varname>imageName</varname>
may transparently refer to a manifest list of images which support
multiple architectures and/or operating systems, supply the `--override-os`
and `--override-arch` arguments to specify exactly which image you
want. By default it will match the OS and architecture of the host the
command is run on.
<programlisting>
$ skopeo inspect docker://docker.io/nixos/nix:1.11 | jq -r '.Digest'
$ nix-shell --packages skopeo jq --command "skopeo --override-os linux --override-arch x86_64 inspect docker://docker.io/nixos/nix:1.11 | jq -r '.Digest'"
sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b
</programlisting>
This argument is required.
@@ -686,6 +694,18 @@ merge:"diff3"
This argument is required.
</para>
</callout>
<callout arearefs='ex-dockerTools-pullImage-5'>
<para>
<varname>os</varname>, if specified, is the operating system of the fetched image.
By default it's <literal>linux</literal>.
</para>
</callout>
<callout arearefs='ex-dockerTools-pullImage-6'>
<para>
<varname>arch</varname>, if specified, is the cpu architecture of the fetched image.
By default it's <literal>x86_64</literal>.
</para>
</callout>
</calloutlist>
</section>

48 changes: 30 additions & 18 deletions doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
@@ -424,7 +424,7 @@ available.

At some point you'll likely have multiple packages which you would
like to be able to use in different projects. In order to minimise unnecessary
duplication we now look at how you can maintain yourself a repository with your
duplication we now look at how you can maintain a repository with your
own packages. The important functions here are `import` and `callPackage`.

### Including a derivation using `callPackage`
@@ -647,7 +647,7 @@ in python.withPackages(ps: [ps.blaze])).env

The `buildPythonApplication` function is practically the same as `buildPythonPackage`.
The difference is that `buildPythonPackage` 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.
Because this is irrelevant for applications, the prefix is omitted.

#### `toPythonApplication` function

@@ -1006,42 +1006,54 @@ folder and not downloaded again.
If you need to change a package's attribute(s) from `configuration.nix` you could do:

```nix
nixpkgs.config.packageOverrides = superP: {
pythonPackages = superP.pythonPackages.override {
overrides = self: super: {
bepasty-server = super.bepasty-server.overrideAttrs ( oldAttrs: {
src = pkgs.fetchgit {
url = "https://github.com/bepasty/bepasty-server";
sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
rev = "e2516e8cf4f2afb5185337073607eb9e84a61d2d";
nixpkgs.config.packageOverrides = super: {
python = super.python.override {
packageOverrides = python-self: python-super: {
zerobin = python-super.zerobin.overrideAttrs (oldAttrs: {
src = super.fetchgit {
url = "https://github.com/sametmax/0bin";
rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec";
sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji";
};
});
};
};
};
```

If you are using the `bepasty-server` package somewhere, for example in `systemPackages` or indirectly from `services.bepasty`, then a `nixos-rebuild switch` will rebuild the system but with the `bepasty-server` package using a different `src` attribute. This way one can modify `python` based software/libraries easily. Using `self` and `super` one can also alter dependencies (`buildInputs`) between the old state (`self`) and new state (`super`).
`pythonPackages.zerobin` is now globally overridden. All packages and also the
`zerobin` NixOS service use the new definition.
Note that `python-super` refers to the old package set and `python-self`
to the new, overridden version.

To modify only a Python package set instead of a whole Python derivation, use this snippet:

```nix
myPythonPackages = pythonPackages.override {
overrides = self: super: {
zerobin = ...;
};
}
```

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

To alter a python package using overlays, you would use the following approach:
Use the following overlay template:

```nix
self: super:
{
python = super.python.override {
packageOverrides = python-self: python-super: {
bepasty-server = python-super.bepasty-server.overrideAttrs ( oldAttrs: {
src = self.pkgs.fetchgit {
url = "https://github.com/bepasty/bepasty-server";
sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
rev = "e2516e8cf4f2afb5185337073607eb9e84a61d2d";
zerobin = python-super.zerobin.overrideAttrs (oldAttrs: {
src = super.fetchgit {
url = "https://github.com/sametmax/0bin";
rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec";
sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji";
};
});
};
};
pythonPackages = self.python.pkgs;
}
```

2 changes: 1 addition & 1 deletion doc/package-notes.xml
Original file line number Diff line number Diff line change
@@ -689,7 +689,7 @@ overrides = super: self: rec {
plugins = with availablePlugins; [
(python.withPackages (ps: with ps; [ pycrypto python-dbus ]))
];
}
};
}
</programlisting>
</para>
4 changes: 2 additions & 2 deletions lib/attrsets.nix
Original file line number Diff line number Diff line change
@@ -3,9 +3,9 @@

let
inherit (builtins) head tail length;
inherit (lib.trivial) and or;
inherit (lib.trivial) and;
inherit (lib.strings) concatStringsSep;
inherit (lib.lists) fold concatMap concatLists all deepSeqList;
inherit (lib.lists) fold concatMap concatLists;
in

rec {
2 changes: 1 addition & 1 deletion lib/composable-derivation.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{lib, pkgs}:
let inherit (lib) nv nvs; in
let inherit (lib) nvs; in
{

# composableDerivation basically mixes these features:
5 changes: 0 additions & 5 deletions lib/customisation.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{ lib }:
let

inherit (builtins) attrNames;

in

rec {

2 changes: 1 addition & 1 deletion lib/debug.nix
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ rec {
(modify depth snip x)) y;

/* A combination of `traceVal` and `traceSeq` */
traceValSeqFn = f: v: traceVal f (builtins.deepSeq v v);
traceValSeqFn = f: v: traceValFn f (builtins.deepSeq v v);
traceValSeq = traceValSeqFn id;

/* A combination of `traceVal` and `traceSeqN`. */
2 changes: 0 additions & 2 deletions lib/generators.nix
Original file line number Diff line number Diff line change
@@ -19,8 +19,6 @@ let
libStr = lib.strings;
libAttr = lib.attrsets;

flipMapAttrs = flip libAttr.mapAttrs;

inherit (lib) isFunction;
in

12 changes: 12 additions & 0 deletions lib/licenses.nix
Original file line number Diff line number Diff line change
@@ -143,6 +143,12 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
free = false;
};

cc-by-nc-40 = spdx {
spdxId = "CC-BY-NC-4.0";
fullName = "Creative Commons Attribution Non Commercial 4.0 International";
free = false;
};

cc-by-nd-30 = spdx {
spdxId = "CC-BY-ND-3.0";
fullName = "Creative Commons Attribution-No Derivative Works v3.00";
@@ -225,6 +231,12 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
fullName = "Eiffel Forum License v2.0";
};

elastic = {
fullName = "ELASTIC LICENSE";
url = https://github.com/elastic/elasticsearch/blob/master/licenses/ELASTIC-LICENSE.txt;
free = false;
};

epl10 = spdx {
spdxId = "EPL-1.0";
fullName = "Eclipse Public License 1.0";
1 change: 0 additions & 1 deletion lib/lists.nix
Original file line number Diff line number Diff line change
@@ -64,7 +64,6 @@ rec {
*/
foldl = op: nul: list:
let
len = length list;
foldl' = n:
if n == -1
then nul
1 change: 0 additions & 1 deletion lib/modules.nix
Original file line number Diff line number Diff line change
@@ -670,7 +670,6 @@ rec {
{ config, options, ... }:
let
fromOpt = getAttrFromPath from options;
toOpt = getAttrFromPath to options;
toOf = attrByPath to
(abort "Renaming error: option `${showOption to}' does not exist.");
in
2 changes: 1 addition & 1 deletion lib/strings.nix
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ rec {
Example:
pkgs = import <nixpkgs> { }
makePerlPath [ pkgs.perlPackages.NetSMTP ]
makePerlPath [ pkgs.perlPackages.libnet ]
=> "/nix/store/n0m1fk9c960d8wlrs62sncnadygqqc6y-perl-Net-SMTP-1.25/lib/perl5/site_perl"
*/
makePerlPath = makeSearchPathOutput "lib" "lib/perl5/site_perl";
1 change: 1 addition & 0 deletions lib/systems/inspect.nix
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ rec {
isAarch64 = { cpu = { family = "arm"; bits = 64; }; };
isMips = { cpu = { family = "mips"; }; };
isRiscV = { cpu = { family = "riscv"; }; };
isSparc = { cpu = { family = "sparc"; }; };
isWasm = { cpu = { family = "wasm"; }; };

is32bit = { cpu = { bits = 32; }; };
13 changes: 9 additions & 4 deletions lib/systems/parse.nix
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
with lib.lists;
with lib.types;
with lib.attrsets;
with lib.strings;
with (import ./inspect.nix { inherit lib; }).predicates;

let
@@ -93,6 +94,9 @@ rec {
riscv32 = { bits = 32; significantByte = littleEndian; family = "riscv"; };
riscv64 = { bits = 64; significantByte = littleEndian; family = "riscv"; };

sparc = { bits = 32; significantByte = bigEndian; family = "sparc"; };
sparc64 = { bits = 64; significantByte = bigEndian; family = "sparc"; };

wasm32 = { bits = 32; significantByte = littleEndian; family = "wasm"; };
wasm64 = { bits = 64; significantByte = littleEndian; family = "wasm"; };
};
@@ -176,9 +180,6 @@ rec {
} // { # aliases
# 'darwin' is the kernel for all of them. We choose macOS by default.
darwin = kernels.macos;
# TODO(@Ericson2314): Handle these Darwin version suffixes more generally.
darwin10 = kernels.macos;
darwin14 = kernels.macos;
watchos = kernels.ios;
tvos = kernels.ios;
win32 = kernels.windows;
@@ -266,6 +267,8 @@ rec {
then { cpu = elemAt l 0; kernel = elemAt l 1; abi = elemAt l 2; }
else if (elemAt l 2 == "mingw32") # autotools breaks on -gnu for window
then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "windows"; abi = "gnu"; }
else if hasPrefix "netbsd" (elemAt l 2)
then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; }
else throw "Target specification with 3 components is ambiguous";
"4" = { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; abi = elemAt l 3; };
}.${toString (length l)}
@@ -292,7 +295,9 @@ rec {
else if isDarwin parsed then vendors.apple
else if isWindows parsed then vendors.pc
else vendors.unknown;
kernel = getKernel args.kernel;
kernel = if hasPrefix "darwin" args.kernel then getKernel "darwin"
else if hasPrefix "netbsd" args.kernel then getKernel "netbsd"
else getKernel args.kernel;
abi =
/**/ if args ? abi then getAbi args.abi
else if isLinux parsed then
4 changes: 0 additions & 4 deletions lib/tests/misc.nix
Original file line number Diff line number Diff line change
@@ -380,10 +380,6 @@ runTests {

resRem7 = res6.replace (a: removeAttrs a ["a"]);

resReplace6 = let x = defaultOverridableDelayableArgs id { a = 7; mergeAttrBy = { a = builtins.add; }; };
x2 = x.merge { a = 20; }; # now we have 27
in (x2.replace) { a = 10; }; # and override the value by 10

# fixed tests (delayed args): (when using them add some comments, please)
resFixed1 =
let x = defaultOverridableDelayableArgs id ( x: { a = 7; c = x.fixed.b; });
Loading