From d8b5ed331d62890285d3ce5a81d336269cdcb394 Mon Sep 17 00:00:00 2001 From: fricklerhandwerk Date: Fri, 23 Apr 2021 10:42:08 +0200 Subject: [PATCH 01/13] doc/using: convert to markdown --- doc/manual.xml | 6 +- doc/using/configuration.chapter.md | 356 +++++++++++++++++++++++ doc/using/configuration.xml | 451 ----------------------------- doc/using/overlays.chapter.md | 149 ++++++++++ doc/using/overlays.xml | 279 ------------------ doc/using/overrides.chapter.md | 104 +++++++ doc/using/overrides.xml | 145 ---------- 7 files changed, 612 insertions(+), 878 deletions(-) create mode 100644 doc/using/configuration.chapter.md delete mode 100644 doc/using/configuration.xml create mode 100644 doc/using/overlays.chapter.md delete mode 100644 doc/using/overlays.xml create mode 100644 doc/using/overrides.chapter.md delete mode 100644 doc/using/overrides.xml diff --git a/doc/manual.xml b/doc/manual.xml index 6ea4addc361a..b43021d85ca5 100644 --- a/doc/manual.xml +++ b/doc/manual.xml @@ -8,9 +8,9 @@ Using Nixpkgs - - - + + + diff --git a/doc/using/configuration.chapter.md b/doc/using/configuration.chapter.md new file mode 100644 index 000000000000..e4d401368796 --- /dev/null +++ b/doc/using/configuration.chapter.md @@ -0,0 +1,356 @@ +# Global configuration {#chap-packageconfig} + +Nix comes with certain defaults about what packages can and cannot be installed, based on a package's metadata. By default, Nix will prevent installation if any of the following criteria are true: + +- The package is thought to be broken, and has had its `meta.broken` set to `true`. + +- The package isn't intended to run on the given system, as none of its `meta.platforms` match the given system. + +- The package's `meta.license` is set to a license which is considered to be unfree. + +- The package has known security vulnerabilities but has not or can not be updated for some reason, and a list of issues has been entered in to the package's `meta.knownVulnerabilities`. + +Note that all this is checked during evaluation already, and the check includes any package that is evaluated. In particular, all build-time dependencies are checked. `nix-env -qa` will (attempt to) hide any packages that would be refused. + +Each of these criteria can be altered in the nixpkgs configuration. + +The nixpkgs configuration for a NixOS system is set in the `configuration.nix`, as in the following example: + +```nix +{ + nixpkgs.config = { + allowUnfree = true; + }; +} +``` + +However, this does not allow unfree software for individual users. Their configurations are managed separately. + +A user's nixpkgs configuration is stored in a user-specific configuration file located at `~/.config/nixpkgs/config.nix`. For example: + +```nix +{ + allowUnfree = true; +} +``` + +Note that we are not able to test or build unfree software on Hydra due to policy. Most unfree licenses prohibit us from either executing or distributing the software. + +## Installing broken packages {#sec-allow-broken} + +There are two ways to try compiling a package which has been marked as broken. + +- For allowing the build of a broken package once, you can use an environment variable for a single invocation of the nix tools: + + ```shellSession + $ export NIXPKGS_ALLOW_BROKEN=1 + ``` + +- For permanently allowing broken packages to be built, you may add `allowBroken = true;` to your user's configuration file, like this: + + ```nix + { + allowBroken = true; + } + ``` + + +## Installing packages on unsupported systems {#sec-allow-unsupported-system} + +There are also two ways to try compiling a package which has been marked as unsupported for the given system. + +- For allowing the build of an unsupported package once, you can use an environment variable for a single invocation of the nix tools: + + ```shellSession + $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 + ``` + +- For permanently allowing unsupported packages to be built, you may add `allowUnsupportedSystem = true;` to your user's configuration file, like this: + + ```nix + { + allowUnsupportedSystem = true; + } + ``` + +The difference between a package being unsupported on some system and being broken is admittedly a bit fuzzy. If a program *ought* to work on a certain platform, but doesn't, the platform should be included in `meta.platforms`, but marked as broken with e.g. `meta.broken = !hostPlatform.isWindows`. Of course, this begs the question of what \"ought\" means exactly. That is left to the package maintainer. + +## Installing unfree packages {#sec-allow-unfree} + +There are several ways to tweak how Nix handles a package which has been marked as unfree. + +- To temporarily allow all unfree packages, you can use an environment variable for a single invocation of the nix tools: + + ```shellSession + $ export NIXPKGS_ALLOW_UNFREE=1 + ``` + +- It is possible to permanently allow individual unfree packages, while still blocking unfree packages by default using the `allowUnfreePredicate` configuration option in the user configuration file. + + This option is a function which accepts a package as a parameter, and returns a boolean. The following example configuration accepts a package and always returns false: + + ```nix + { + allowUnfreePredicate = (pkg: false); + } + ``` + + For a more useful example, try the following. This configuration only allows unfree packages named roon-server and visual studio code: + + ```nix + { + allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "roon-server" + "vscode" + ]; + } + ``` + +- It is also possible to allow and block licenses that are specifically acceptable or not acceptable, using `allowlistedLicenses` and `blocklistedLicenses`, respectively. + + The following example configuration allowlists the licenses `amd` and `wtfpl`: + + ```nix + { + allowlistedLicenses = with lib.licenses; [ amd wtfpl ]; + } + ``` + + The following example configuration blocklists the `gpl3Only` and `agpl3Only` licenses: + + ```nix + { + blocklistedLicenses = with lib.licenses; [ agpl3Only gpl3Only ]; + } + ``` + + Note that `allowlistedLicenses` only applies to unfree licenses unless `allowUnfree` is enabled. It is not a generic allowlist for all types of licenses. `blocklistedLicenses` applies to all licenses. + +A complete list of licenses can be found in the file `lib/licenses.nix` of the nixpkgs tree. + +## Installing insecure packages {#sec-allow-insecure} + +There are several ways to tweak how Nix handles a package which has been marked as insecure. + +- To temporarily allow all insecure packages, you can use an environment variable for a single invocation of the nix tools: + + ```shellSession + $ export NIXPKGS_ALLOW_INSECURE=1 + ``` + +- It is possible to permanently allow individual insecure packages, while still blocking other insecure packages by default using the `permittedInsecurePackages` configuration option in the user configuration file. + + The following example configuration permits the installation of the hypothetically insecure package `hello`, version `1.2.3`: + + ```nix + { + permittedInsecurePackages = [ + "hello-1.2.3" + ]; + } + ``` + +- It is also possible to create a custom policy around which insecure packages to allow and deny, by overriding the `allowInsecurePredicate` configuration option. + + The `allowInsecurePredicate` option is a function which accepts a package and returns a boolean, much like `allowUnfreePredicate`. + + The following configuration example only allows insecure packages with very short names: + + ```nix + { + allowInsecurePredicate = pkg: builtins.stringLength (lib.getName pkg) <= 5; + } + ``` + + Note that `permittedInsecurePackages` is only checked if `allowInsecurePredicate` is not specified. + +## Modify packages via `packageOverrides` {#sec-modify-via-packageOverrides} + +You can define a function called `packageOverrides` in your local `~/.config/nixpkgs/config.nix` to override Nix packages. It must be a function that takes pkgs as an argument and returns a modified set of packages. + +```nix +{ + packageOverrides = pkgs: rec { + foo = pkgs.foo.override { ... }; + }; +} +``` + +## Declarative Package Management {#sec-declarative-package-management} + +### Build an environment {#sec-building-environment} + +Using `packageOverrides`, it is possible to manage packages declaratively. This means that we can list all of our desired packages within a declarative Nix expression. For example, to have `aspell`, `bc`, `ffmpeg`, `coreutils`, `gdb`, `nixUnstable`, `emscripten`, `jq`, `nox`, and `silver-searcher`, we could use the following in `~/.config/nixpkgs/config.nix`: + +```nix +{ + packageOverrides = pkgs: with pkgs; { + myPackages = pkgs.buildEnv { + name = "my-packages"; + paths = [ + aspell + bc + coreutils + gdb + ffmpeg + nixUnstable + emscripten + jq + nox + silver-searcher + ]; + }; + }; +} +``` + +To install it into our environment, you can just run `nix-env -iA nixpkgs.myPackages`. If you want to load the packages to be built from a working copy of `nixpkgs` you just run `nix-env -f. -iA myPackages`. To explore what's been installed, just look through `~/.nix-profile/`. You can see that a lot of stuff has been installed. Some of this stuff is useful some of it isn't. Let's tell Nixpkgs to only link the stuff that we want: + +```nix +{ + packageOverrides = pkgs: with pkgs; { + myPackages = pkgs.buildEnv { + name = "my-packages"; + paths = [ + aspell + bc + coreutils + gdb + ffmpeg + nixUnstable + emscripten + jq + nox + silver-searcher + ]; + pathsToLink = [ "/share" "/bin" ]; + }; + }; +} +``` + +`pathsToLink` tells Nixpkgs to only link the paths listed which gets rid of the extra stuff in the profile. `/bin` and `/share` are good defaults for a user environment, getting rid of the clutter. If you are running on Nix on MacOS, you may want to add another path as well, `/Applications`, that makes GUI apps available. + +### Getting documentation {#sec-getting-documentation} + +After building that new environment, look through `~/.nix-profile` to make sure everything is there that we wanted. Discerning readers will note that some files are missing. Look inside `~/.nix-profile/share/man/man1/` to verify this. There are no man pages for any of the Nix tools! This is because some packages like Nix have multiple outputs for things like documentation (see section 4). Let's make Nix install those as well. + +```nix +{ + packageOverrides = pkgs: with pkgs; { + myPackages = pkgs.buildEnv { + name = "my-packages"; + paths = [ + aspell + bc + coreutils + ffmpeg + nixUnstable + emscripten + jq + nox + silver-searcher + ]; + pathsToLink = [ "/share/man" "/share/doc" "/bin" ]; + extraOutputsToInstall = [ "man" "doc" ]; + }; + }; +} +``` + +This provides us with some useful documentation for using our packages. However, if we actually want those manpages to be detected by man, we need to set up our environment. This can also be managed within Nix expressions. + +```nix +{ + packageOverrides = pkgs: with pkgs; rec { + myProfile = writeText "my-profile" '' + export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin + export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man + ''; + myPackages = pkgs.buildEnv { + name = "my-packages"; + paths = [ + (runCommand "profile" {} '' + mkdir -p $out/etc/profile.d + cp ${myProfile} $out/etc/profile.d/my-profile.sh + '') + aspell + bc + coreutils + ffmpeg + man + nixUnstable + emscripten + jq + nox + silver-searcher + ]; + pathsToLink = [ "/share/man" "/share/doc" "/bin" "/etc" ]; + extraOutputsToInstall = [ "man" "doc" ]; + }; + }; +} +``` + +For this to work fully, you must also have this script sourced when you are logged in. Try adding something like this to your `~/.profile` file: + +```shellSession +#!/bin/sh +if [ -d $HOME/.nix-profile/etc/profile.d ]; then + for i in $HOME/.nix-profile/etc/profile.d/*.sh; do + if [ -r $i ]; then + . $i + fi + done +fi +``` + +Now just run `source $HOME/.profile` and you can starting loading man pages from your environment. + +### GNU info setup {#sec-gnu-info-setup} + +Configuring GNU info is a little bit trickier than man pages. To work correctly, info needs a database to be generated. This can be done with some small modifications to our environment scripts. + +```nix +{ + packageOverrides = pkgs: with pkgs; rec { + myProfile = writeText "my-profile" '' + export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin + export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man + export INFOPATH=$HOME/.nix-profile/share/info:/nix/var/nix/profiles/default/share/info:/usr/share/info + ''; + myPackages = pkgs.buildEnv { + name = "my-packages"; + paths = [ + (runCommand "profile" {} '' + mkdir -p $out/etc/profile.d + cp ${myProfile} $out/etc/profile.d/my-profile.sh + '') + aspell + bc + coreutils + ffmpeg + man + nixUnstable + emscripten + jq + nox + silver-searcher + texinfoInteractive + ]; + pathsToLink = [ "/share/man" "/share/doc" "/share/info" "/bin" "/etc" ]; + extraOutputsToInstall = [ "man" "doc" "info" ]; + postBuild = '' + if [ -x $out/bin/install-info -a -w $out/share/info ]; then + shopt -s nullglob + for i in $out/share/info/*.info $out/share/info/*.info.gz; do + $out/bin/install-info $i $out/share/info/dir + done + fi + ''; + }; + }; +} +``` + +`postBuild` tells Nixpkgs to run a command after building the environment. In this case, `install-info` adds the installed info pages to `dir` which is GNU info's default root node. Note that `texinfoInteractive` is added to the environment to give the `install-info` command. diff --git a/doc/using/configuration.xml b/doc/using/configuration.xml deleted file mode 100644 index 3ef39733458c..000000000000 --- a/doc/using/configuration.xml +++ /dev/null @@ -1,451 +0,0 @@ - - Global configuration - - Nix comes with certain defaults about what packages can and cannot be installed, based on a package's metadata. By default, Nix will prevent installation if any of the following criteria are true: - - - - - The package is thought to be broken, and has had its meta.broken set to true. - - - - - The package isn't intended to run on the given system, as none of its meta.platforms match the given system. - - - - - The package's meta.license is set to a license which is considered to be unfree. - - - - - The package has known security vulnerabilities but has not or can not be updated for some reason, and a list of issues has been entered in to the package's meta.knownVulnerabilities. - - - - - Note that all this is checked during evaluation already, and the check includes any package that is evaluated. In particular, all build-time dependencies are checked. nix-env -qa will (attempt to) hide any packages that would be refused. - - - Each of these criteria can be altered in the nixpkgs configuration. - - - The nixpkgs configuration for a NixOS system is set in the configuration.nix, as in the following example: - -{ - nixpkgs.config = { - allowUnfree = true; - }; -} - - However, this does not allow unfree software for individual users. Their configurations are managed separately. - - - A user's nixpkgs configuration is stored in a user-specific configuration file located at ~/.config/nixpkgs/config.nix. For example: - -{ - allowUnfree = true; -} - - - - Note that we are not able to test or build unfree software on Hydra due to policy. Most unfree licenses prohibit us from either executing or distributing the software. - -
- Installing broken packages - - - There are two ways to try compiling a package which has been marked as broken. - - - - - - For allowing the build of a broken package once, you can use an environment variable for a single invocation of the nix tools: -$ export NIXPKGS_ALLOW_BROKEN=1 - - - - - For permanently allowing broken packages to be built, you may add allowBroken = true; to your user's configuration file, like this: - -{ - allowBroken = true; -} - - - - -
-
- Installing packages on unsupported systems - - - There are also two ways to try compiling a package which has been marked as unsupported for the given system. - - - - - - For allowing the build of an unsupported package once, you can use an environment variable for a single invocation of the nix tools: -$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 - - - - - For permanently allowing unsupported packages to be built, you may add allowUnsupportedSystem = true; to your user's configuration file, like this: - -{ - allowUnsupportedSystem = true; -} - - - - - - - The difference between a package being unsupported on some system and being broken is admittedly a bit fuzzy. If a program ought to work on a certain platform, but doesn't, the platform should be included in meta.platforms, but marked as broken with e.g. meta.broken = !hostPlatform.isWindows. Of course, this begs the question of what "ought" means exactly. That is left to the package maintainer. - -
-
- Installing unfree packages - - - There are several ways to tweak how Nix handles a package which has been marked as unfree. - - - - - - To temporarily allow all unfree packages, you can use an environment variable for a single invocation of the nix tools: -$ export NIXPKGS_ALLOW_UNFREE=1 - - - - - It is possible to permanently allow individual unfree packages, while still blocking unfree packages by default using the allowUnfreePredicate configuration option in the user configuration file. - - - This option is a function which accepts a package as a parameter, and returns a boolean. The following example configuration accepts a package and always returns false: - -{ - allowUnfreePredicate = (pkg: false); -} - - - - For a more useful example, try the following. This configuration only allows unfree packages named roon-server and visual studio code: - -{ - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "roon-server" - "vscode" - ]; -} - - - - - - It is also possible to allow and block licenses that are specifically acceptable or not acceptable, using allowlistedLicenses and blocklistedLicenses, respectively. - - - The following example configuration allowlists the licenses amd and wtfpl: - -{ - allowlistedLicenses = with lib.licenses; [ amd wtfpl ]; -} - - - - The following example configuration blocklists the gpl3Only and agpl3Only licenses: - -{ - blocklistedLicenses = with lib.licenses; [ agpl3Only gpl3Only ]; -} - - - - Note that allowlistedLicenses only applies to unfree licenses unless allowUnfree is enabled. It is not a generic allowlist for all types of licenses. blocklistedLicenses applies to all licenses. - - - - - - A complete list of licenses can be found in the file lib/licenses.nix of the nixpkgs tree. - -
-
- Installing insecure packages - - - There are several ways to tweak how Nix handles a package which has been marked as insecure. - - - - - - To temporarily allow all insecure packages, you can use an environment variable for a single invocation of the nix tools: -$ export NIXPKGS_ALLOW_INSECURE=1 - - - - - It is possible to permanently allow individual insecure packages, while still blocking other insecure packages by default using the permittedInsecurePackages configuration option in the user configuration file. - - - The following example configuration permits the installation of the hypothetically insecure package hello, version 1.2.3: - -{ - permittedInsecurePackages = [ - "hello-1.2.3" - ]; -} - - - - - - It is also possible to create a custom policy around which insecure packages to allow and deny, by overriding the allowInsecurePredicate configuration option. - - - The allowInsecurePredicate option is a function which accepts a package and returns a boolean, much like allowUnfreePredicate. - - - The following configuration example only allows insecure packages with very short names: - -{ - allowInsecurePredicate = pkg: builtins.stringLength (lib.getName pkg) <= 5; -} - - - - Note that permittedInsecurePackages is only checked if allowInsecurePredicate is not specified. - - - -
- -
- Modify packages via <literal>packageOverrides</literal> - - - You can define a function called packageOverrides in your local ~/.config/nixpkgs/config.nix to override Nix packages. It must be a function that takes pkgs as an argument and returns a modified set of packages. - -{ - packageOverrides = pkgs: rec { - foo = pkgs.foo.override { ... }; - }; -} - - -
-
- Declarative Package Management - -
- Build an environment - - - Using packageOverrides, it is possible to manage packages declaratively. This means that we can list all of our desired packages within a declarative Nix expression. For example, to have aspell, bc, ffmpeg, coreutils, gdb, nixUnstable, emscripten, jq, nox, and silver-searcher, we could use the following in ~/.config/nixpkgs/config.nix: - - - -{ - packageOverrides = pkgs: with pkgs; { - myPackages = pkgs.buildEnv { - name = "my-packages"; - paths = [ - aspell - bc - coreutils - gdb - ffmpeg - nixUnstable - emscripten - jq - nox - silver-searcher - ]; - }; - }; -} - - - - To install it into our environment, you can just run nix-env -iA nixpkgs.myPackages. If you want to load the packages to be built from a working copy of nixpkgs you just run nix-env -f. -iA myPackages. To explore what's been installed, just look through ~/.nix-profile/. You can see that a lot of stuff has been installed. Some of this stuff is useful some of it isn't. Let's tell Nixpkgs to only link the stuff that we want: - - - -{ - packageOverrides = pkgs: with pkgs; { - myPackages = pkgs.buildEnv { - name = "my-packages"; - paths = [ - aspell - bc - coreutils - gdb - ffmpeg - nixUnstable - emscripten - jq - nox - silver-searcher - ]; - pathsToLink = [ "/share" "/bin" ]; - }; - }; -} - - - - pathsToLink tells Nixpkgs to only link the paths listed which gets rid of the extra stuff in the profile. /bin and /share are good defaults for a user environment, getting rid of the clutter. If you are running on Nix on MacOS, you may want to add another path as well, /Applications, that makes GUI apps available. - -
- -
- Getting documentation - - - After building that new environment, look through ~/.nix-profile to make sure everything is there that we wanted. Discerning readers will note that some files are missing. Look inside ~/.nix-profile/share/man/man1/ to verify this. There are no man pages for any of the Nix tools! This is because some packages like Nix have multiple outputs for things like documentation (see section 4). Let's make Nix install those as well. - - - -{ - packageOverrides = pkgs: with pkgs; { - myPackages = pkgs.buildEnv { - name = "my-packages"; - paths = [ - aspell - bc - coreutils - ffmpeg - nixUnstable - emscripten - jq - nox - silver-searcher - ]; - pathsToLink = [ "/share/man" "/share/doc" "/bin" ]; - extraOutputsToInstall = [ "man" "doc" ]; - }; - }; -} - - - - This provides us with some useful documentation for using our packages. However, if we actually want those manpages to be detected by man, we need to set up our environment. This can also be managed within Nix expressions. - - - -{ - packageOverrides = pkgs: with pkgs; rec { - myProfile = writeText "my-profile" '' - export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin - export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man - ''; - myPackages = pkgs.buildEnv { - name = "my-packages"; - paths = [ - (runCommand "profile" {} '' - mkdir -p $out/etc/profile.d - cp ${myProfile} $out/etc/profile.d/my-profile.sh - '') - aspell - bc - coreutils - ffmpeg - man - nixUnstable - emscripten - jq - nox - silver-searcher - ]; - pathsToLink = [ "/share/man" "/share/doc" "/bin" "/etc" ]; - extraOutputsToInstall = [ "man" "doc" ]; - }; - }; -} - - - - For this to work fully, you must also have this script sourced when you are logged in. Try adding something like this to your ~/.profile file: - - - -#!/bin/sh -if [ -d $HOME/.nix-profile/etc/profile.d ]; then - for i in $HOME/.nix-profile/etc/profile.d/*.sh; do - if [ -r $i ]; then - . $i - fi - done -fi - - - - Now just run source $HOME/.profile and you can starting loading man pages from your environment. - -
- -
- GNU info setup - - - Configuring GNU info is a little bit trickier than man pages. To work correctly, info needs a database to be generated. This can be done with some small modifications to our environment scripts. - - - -{ - packageOverrides = pkgs: with pkgs; rec { - myProfile = writeText "my-profile" '' - export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin - export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man - export INFOPATH=$HOME/.nix-profile/share/info:/nix/var/nix/profiles/default/share/info:/usr/share/info - ''; - myPackages = pkgs.buildEnv { - name = "my-packages"; - paths = [ - (runCommand "profile" {} '' - mkdir -p $out/etc/profile.d - cp ${myProfile} $out/etc/profile.d/my-profile.sh - '') - aspell - bc - coreutils - ffmpeg - man - nixUnstable - emscripten - jq - nox - silver-searcher - texinfoInteractive - ]; - pathsToLink = [ "/share/man" "/share/doc" "/share/info" "/bin" "/etc" ]; - extraOutputsToInstall = [ "man" "doc" "info" ]; - postBuild = '' - if [ -x $out/bin/install-info -a -w $out/share/info ]; then - shopt -s nullglob - for i in $out/share/info/*.info $out/share/info/*.info.gz; do - $out/bin/install-info $i $out/share/info/dir - done - fi - ''; - }; - }; -} - - - - postBuild tells Nixpkgs to run a command after building the environment. In this case, install-info adds the installed info pages to dir which is GNU info's default root node. Note that texinfoInteractive is added to the environment to give the install-info command. - -
-
-
diff --git a/doc/using/overlays.chapter.md b/doc/using/overlays.chapter.md new file mode 100644 index 000000000000..935583a91e24 --- /dev/null +++ b/doc/using/overlays.chapter.md @@ -0,0 +1,149 @@ +# Overlays {#chap-overlays} + +This chapter describes how to extend and change Nixpkgs using overlays. Overlays are used to add layers in the fixed-point used by Nixpkgs to compose the set of all packages. + +Nixpkgs can be configured with a list of overlays, which are applied in order. This means that the order of the overlays can be significant if multiple layers override the same package. + +## Installing overlays {#sec-overlays-install} + +The list of overlays can be set either explicitly in a Nix expression, or through `` or user configuration files. + +### Set overlays in NixOS or Nix expressions {#sec-overlays-argument} + +On a NixOS system the value of the `nixpkgs.overlays` option, if present, is passed to the system Nixpkgs directly as an argument. Note that this does not affect the overlays for non-NixOS operations (e.g. `nix-env`), which are [looked up](#sec-overlays-lookup) independently. + +The list of overlays can be passed explicitly when importing nixpkgs, for example `import { overlays = [ overlay1 overlay2 ]; }`. + +NOTE: DO NOT USE THIS in nixpkgs. Further overlays can be added by calling the `pkgs.extend` or `pkgs.appendOverlays`, although it is often preferable to avoid these functions, because they recompute the Nixpkgs fixpoint, which is somewhat expensive to do. + +### Install overlays via configuration lookup {#sec-overlays-lookup} + +The list of overlays is determined as follows. + +1. First, if an [`overlays` argument](#sec-overlays-argument) to the Nixpkgs function itself is given, then that is used and no path lookup will be performed. + +2. Otherwise, if the Nix path entry `` exists, we look for overlays at that path, as described below. + + See the section on `NIX_PATH` in the Nix manual for more details on how to set a value for `.` + +3. If one of `~/.config/nixpkgs/overlays.nix` and `~/.config/nixpkgs/overlays/` exists, then we look for overlays at that path, as described below. It is an error if both exist. + +If we are looking for overlays at a path, then there are two cases: + +- If the path is a file, then the file is imported as a Nix expression and used as the list of overlays. + +- If the path is a directory, then we take the content of the directory, order it lexicographically, and attempt to interpret each as an overlay by: + + - Importing the file, if it is a `.nix` file. + + - Importing a top-level `default.nix` file, if it is a directory. + +Because overlays that are set in NixOS configuration do not affect non-NixOS operations such as `nix-env`, the `overlays.nix` option provides a convenient way to use the same overlays for a NixOS system configuration and user configuration: the same file can be used as `overlays.nix` and imported as the value of `nixpkgs.overlays`. + +## Defining overlays {#sec-overlays-definition} + +Overlays are Nix functions which accept two arguments, conventionally called `self` and `super`, and return a set of packages. For example, the following is a valid overlay. + +```nix +self: super: + +{ + boost = super.boost.override { + python = self.python3; + }; + rr = super.callPackage ./pkgs/rr { + stdenv = self.stdenv_32bit; + }; +} +``` + +The first argument (`self`) corresponds to the final package set. You should use this set for the dependencies of all packages specified in your overlay. For example, all the dependencies of `rr` in the example above come from `self`, as well as the overridden dependencies used in the `boost` override. + +The second argument (`super`) corresponds to the result of the evaluation of the previous stages of Nixpkgs. It does not contain any of the packages added by the current overlay, nor any of the following overlays. This set should be used either to refer to packages you wish to override, or to access functions defined in Nixpkgs. For example, the original recipe of `boost` in the above example, comes from `super`, as well as the `callPackage` function. + +The value returned by this function should be a set similar to `pkgs/top-level/all-packages.nix`, containing overridden and/or new packages. + +Overlays are similar to other methods for customizing Nixpkgs, in particular the `packageOverrides` attribute described in . Indeed, `packageOverrides` acts as an overlay with only the `super` argument. It is therefore appropriate for basic use, but overlays are more powerful and easier to distribute. + +## Using overlays to configure alternatives {#sec-overlays-alternatives} + +Certain software packages have different implementations of the same interface. Other distributions have functionality to switch between these. For example, Debian provides [DebianAlternatives](https://wiki.debian.org/DebianAlternatives). Nixpkgs has what we call `alternatives`, which are configured through overlays. + +### BLAS/LAPACK {#sec-overlays-alternatives-blas-lapack} + +In Nixpkgs, we have multiple implementations of the BLAS/LAPACK numerical linear algebra interfaces. They are: + +- [OpenBLAS](https://www.openblas.net/) + + The Nixpkgs attribute is `openblas` for ILP64 (integer width = 64 bits) and `openblasCompat` for LP64 (integer width = 32 bits). `openblasCompat` is the default. + +- [LAPACK reference](http://www.netlib.org/lapack/) (also provides BLAS) + + The Nixpkgs attribute is `lapack-reference`. + +- [Intel MKL](https://software.intel.com/en-us/mkl) (only works on the x86_64 architecture, unfree) + + The Nixpkgs attribute is `mkl`. + +- [BLIS](https://github.com/flame/blis) + + BLIS, available through the attribute `blis`, is a framework for linear algebra kernels. In addition, it implements the BLAS interface. + +- [AMD BLIS/LIBFLAME](https://developer.amd.com/amd-aocl/blas-library/) (optimized for modern AMD x86_64 CPUs) + + The AMD fork of the BLIS library, with attribute `amd-blis`, extends BLIS with optimizations for modern AMD CPUs. The changes are usually submitted to the upstream BLIS project after some time. However, AMD BLIS typically provides some performance improvements on AMD Zen CPUs. The complementary AMD LIBFLAME library, with attribute `amd-libflame`, provides a LAPACK implementation. + +Introduced in [PR #83888](https://github.com/NixOS/nixpkgs/pull/83888), we are able to override the `blas` and `lapack` packages to use different implementations, through the `blasProvider` and `lapackProvider` argument. This can be used to select a different provider. BLAS providers will have symlinks in `$out/lib/libblas.so.3` and `$out/lib/libcblas.so.3` to their respective BLAS libraries. Likewise, LAPACK providers will have symlinks in `$out/lib/liblapack.so.3` and `$out/lib/liblapacke.so.3` to their respective LAPACK libraries. For example, Intel MKL is both a BLAS and LAPACK provider. An overlay can be created to use Intel MKL that looks like: + +```nix +self: super: + +{ + blas = super.blas.override { + blasProvider = self.mkl; + }; + + lapack = super.lapack.override { + lapackProvider = self.mkl; + }; +} +``` + +This overlay uses Intel's MKL library for both BLAS and LAPACK interfaces. Note that the same can be accomplished at runtime using `LD_LIBRARY_PATH` of `libblas.so.3` and `liblapack.so.3`. For instance: + +```shellSession +$ LD_LIBRARY_PATH=$(nix-build -A mkl)/lib:$LD_LIBRARY_PATH nix-shell -p octave --run octave +``` + +Intel MKL requires an `openmp` implementation when running with multiple processors. By default, `mkl` will use Intel's `iomp` implementation if no other is specified, but this is a runtime-only dependency and binary compatible with the LLVM implementation. To use that one instead, Intel recommends users set it with `LD_PRELOAD`. Note that `mkl` is only available on `x86_64-linux` and `x86_64-darwin`. Moreover, Hydra is not building and distributing pre-compiled binaries using it. + +For BLAS/LAPACK switching to work correctly, all packages must depend on `blas` or `lapack`. This ensures that only one BLAS/LAPACK library is used at one time. There are two versions of BLAS/LAPACK currently in the wild, `LP64` (integer size = 32 bits) and `ILP64` (integer size = 64 bits). Some software needs special flags or patches to work with `ILP64`. You can check if `ILP64` is used in Nixpkgs with `blas.isILP64` and `lapack.isILP64`. Some software does NOT work with `ILP64`, and derivations need to specify an assertion to prevent this. You can prevent `ILP64` from being used with the following: + +```nix +{ stdenv, blas, lapack, ... }: + +assert (!blas.isILP64) && (!lapack.isILP64); + +stdenv.mkDerivation { + ... +} +``` + +### Switching the MPI implementation {#sec-overlays-alternatives-mpi} + +All programs that are built with [MPI](https://en.wikipedia.org/wiki/Message_Passing_Interface) support use the generic attribute `mpi` as an input. At the moment Nixpkgs natively provides two different MPI implementations: + +- [Open MPI](https://www.open-mpi.org/) (default), attribute name + `openmpi` + +- [MPICH](https://www.mpich.org/), attribute name `mpich` + +To provide MPI enabled applications that use `MPICH`, instead of the default `Open MPI`, simply use the following overlay: + +```nix +self: super: + +{ + mpi = self.mpich; +} +``` diff --git a/doc/using/overlays.xml b/doc/using/overlays.xml deleted file mode 100644 index 8f12aad2adad..000000000000 --- a/doc/using/overlays.xml +++ /dev/null @@ -1,279 +0,0 @@ - - Overlays - - This chapter describes how to extend and change Nixpkgs using overlays. Overlays are used to add layers in the fixed-point used by Nixpkgs to compose the set of all packages. - - - Nixpkgs can be configured with a list of overlays, which are applied in order. This means that the order of the overlays can be significant if multiple layers override the same package. - - -
- Installing overlays - - - The list of overlays can be set either explicitly in a Nix expression, or through <nixpkgs-overlays> or user configuration files. - - -
- Set overlays in NixOS or Nix expressions - - - On a NixOS system the value of the nixpkgs.overlays option, if present, is passed to the system Nixpkgs directly as an argument. Note that this does not affect the overlays for non-NixOS operations (e.g. nix-env), which are looked up independently. - - - - The list of overlays can be passed explicitly when importing nixpkgs, for example import <nixpkgs> { overlays = [ overlay1 overlay2 ]; }. - - - - NOTE: DO NOT USE THIS in nixpkgs. Further overlays can be added by calling the pkgs.extend or pkgs.appendOverlays, although it is often preferable to avoid these functions, because they recompute the Nixpkgs fixpoint, which is somewhat expensive to do. - -
- -
- Install overlays via configuration lookup - - - The list of overlays is determined as follows. - - - - - - - First, if an overlays argument to the Nixpkgs function itself is given, then that is used and no path lookup will be performed. - - - - - Otherwise, if the Nix path entry <nixpkgs-overlays> exists, we look for overlays at that path, as described below. - - - See the section on NIX_PATH in the Nix manual for more details on how to set a value for <nixpkgs-overlays>. - - - - - If one of ~/.config/nixpkgs/overlays.nix and ~/.config/nixpkgs/overlays/ exists, then we look for overlays at that path, as described below. It is an error if both exist. - - - - - - - If we are looking for overlays at a path, then there are two cases: - - - - If the path is a file, then the file is imported as a Nix expression and used as the list of overlays. - - - - - If the path is a directory, then we take the content of the directory, order it lexicographically, and attempt to interpret each as an overlay by: - - - - Importing the file, if it is a .nix file. - - - - - Importing a top-level default.nix file, if it is a directory. - - - - - - - - - - Because overlays that are set in NixOS configuration do not affect non-NixOS operations such as nix-env, the overlays.nix option provides a convenient way to use the same overlays for a NixOS system configuration and user configuration: the same file can be used as overlays.nix and imported as the value of nixpkgs.overlays. - - - -
-
- -
- Defining overlays - - - Overlays are Nix functions which accept two arguments, conventionally called self and super, and return a set of packages. For example, the following is a valid overlay. - - - -self: super: - -{ - boost = super.boost.override { - python = self.python3; - }; - rr = super.callPackage ./pkgs/rr { - stdenv = self.stdenv_32bit; - }; -} - - - - The first argument (self) corresponds to the final package set. You should use this set for the dependencies of all packages specified in your overlay. For example, all the dependencies of rr in the example above come from self, as well as the overridden dependencies used in the boost override. - - - - The second argument (super) corresponds to the result of the evaluation of the previous stages of Nixpkgs. It does not contain any of the packages added by the current overlay, nor any of the following overlays. This set should be used either to refer to packages you wish to override, or to access functions defined in Nixpkgs. For example, the original recipe of boost in the above example, comes from super, as well as the callPackage function. - - - - The value returned by this function should be a set similar to pkgs/top-level/all-packages.nix, containing overridden and/or new packages. - - - - Overlays are similar to other methods for customizing Nixpkgs, in particular the packageOverrides attribute described in . Indeed, packageOverrides acts as an overlay with only the super argument. It is therefore appropriate for basic use, but overlays are more powerful and easier to distribute. - -
-
- Using overlays to configure alternatives - - - Certain software packages have different implementations of the same interface. Other distributions have functionality to switch between these. For example, Debian provides DebianAlternatives. Nixpkgs has what we call alternatives, which are configured through overlays. - - -
- BLAS/LAPACK - - - In Nixpkgs, we have multiple implementations of the BLAS/LAPACK numerical linear algebra interfaces. They are: - - - - - - OpenBLAS - - - The Nixpkgs attribute is openblas for ILP64 (integer width = 64 bits) and openblasCompat for LP64 (integer width = 32 bits). openblasCompat is the default. - - - - - LAPACK reference (also provides BLAS) - - - The Nixpkgs attribute is lapack-reference. - - - - - Intel MKL (only works on the x86_64 architecture, unfree) - - - The Nixpkgs attribute is mkl. - - - - - BLIS - - - BLIS, available through the attribute blis, is a framework for linear algebra kernels. In addition, it implements the BLAS interface. - - - - - AMD BLIS/LIBFLAME (optimized for modern AMD x86_64 CPUs) - - - The AMD fork of the BLIS library, with attribute amd-blis, extends BLIS with optimizations for modern AMD CPUs. The changes are usually submitted to the upstream BLIS project after some time. However, AMD BLIS typically provides some performance improvements on AMD Zen CPUs. The complementary AMD LIBFLAME library, with attribute amd-libflame, provides a LAPACK implementation. - - - - - - Introduced in PR #83888, we are able to override the blas and lapack packages to use different implementations, through the blasProvider and lapackProvider argument. This can be used to select a different provider. BLAS providers will have symlinks in $out/lib/libblas.so.3 and $out/lib/libcblas.so.3 to their respective BLAS libraries. Likewise, LAPACK providers will have symlinks in $out/lib/liblapack.so.3 and $out/lib/liblapacke.so.3 to their respective LAPACK libraries. For example, Intel MKL is both a BLAS and LAPACK provider. An overlay can be created to use Intel MKL that looks like: - - - -self: super: - -{ - blas = super.blas.override { - blasProvider = self.mkl; - }; - - lapack = super.lapack.override { - lapackProvider = self.mkl; - }; -} - - - - This overlay uses Intel’s MKL library for both BLAS and LAPACK interfaces. Note that the same can be accomplished at runtime using LD_LIBRARY_PATH of libblas.so.3 and liblapack.so.3. For instance: - - - -$ LD_LIBRARY_PATH=$(nix-build -A mkl)/lib:$LD_LIBRARY_PATH nix-shell -p octave --run octave - - - - Intel MKL requires an openmp implementation when running with multiple processors. By default, mkl will use Intel’s iomp implementation if no other is specified, but this is a runtime-only dependency and binary compatible with the LLVM implementation. To use that one instead, Intel recommends users set it with LD_PRELOAD. Note that mkl is only available on x86_64-linux and x86_64-darwin. Moreover, Hydra is not building and distributing pre-compiled binaries using it. - - - - For BLAS/LAPACK switching to work correctly, all packages must depend on blas or lapack. This ensures that only one BLAS/LAPACK library is used at one time. There are two versions of BLAS/LAPACK currently in the wild, LP64 (integer size = 32 bits) and ILP64 (integer size = 64 bits). Some software needs special flags or patches to work with ILP64. You can check if ILP64 is used in Nixpkgs with blas.isILP64 and lapack.isILP64. Some software does NOT work with ILP64, and derivations need to specify an assertion to prevent this. You can prevent ILP64 from being used with the following: - - - -{ stdenv, blas, lapack, ... }: - -assert (!blas.isILP64) && (!lapack.isILP64); - -stdenv.mkDerivation { - ... -} - -
- -
- Switching the MPI implementation - - - All programs that are built with MPI support use the generic attribute mpi as an input. At the moment Nixpkgs natively provides two different MPI implementations: - - - - Open MPI (default), attribute name openmpi - - - - - MPICH, attribute name mpich - - - - - - - To provide MPI enabled applications that use MPICH, instead of the default Open MPI, simply use the following overlay: - - - -self: super: - -{ - mpi = self.mpich; -} - -
-
-
diff --git a/doc/using/overrides.chapter.md b/doc/using/overrides.chapter.md new file mode 100644 index 000000000000..c1ab710e061b --- /dev/null +++ b/doc/using/overrides.chapter.md @@ -0,0 +1,104 @@ +# Overriding {#chap-overrides} + +Sometimes one wants to override parts of `nixpkgs`, e.g. derivation attributes, the results of derivations. + +These functions are used to make changes to packages, returning only single packages. [Overlays](#chap-overlays), on the other hand, can be used to combine the overridden packages across the entire package set of Nixpkgs. + +## <pkg>.override {#sec-pkg-override} + +The function `override` is usually available for all the derivations in the nixpkgs expression (`pkgs`). + +It is used to override the arguments passed to a function. + +Example usages: + +```nix +pkgs.foo.override { arg1 = val1; arg2 = val2; ... } +``` + + + +```nix +import pkgs.path { overlays = [ (self: super: { + foo = super.foo.override { barSupport = true ; }; + })]}; +``` + +```nix +mypkg = pkgs.callPackage ./mypkg.nix { + mydep = pkgs.mydep.override { ... }; + } +``` + +In the first example, `pkgs.foo` is the result of a function call with some default arguments, usually a derivation. Using `pkgs.foo.override` will call the same function with the given new arguments. + +## <pkg>.overrideAttrs {#sec-pkg-overrideAttrs} + +The function `overrideAttrs` allows overriding the attribute set passed to a `stdenv.mkDerivation` call, producing a new derivation based on the original one. This function is available on all derivations produced by the `stdenv.mkDerivation` function, which is most packages in the nixpkgs expression `pkgs`. + +Example usage: + +```nix +helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec { + separateDebugInfo = true; +}); +``` + +In the above example, the `separateDebugInfo` attribute is overridden to be true, thus building debug info for `helloWithDebug`, while all other attributes will be retained from the original `hello` package. + +The argument `oldAttrs` is conventionally used to refer to the attr set originally passed to `stdenv.mkDerivation`. + +::: note +Note that `separateDebugInfo` is processed only by the `stdenv.mkDerivation` function, not the generated, raw Nix derivation. Thus, using `overrideDerivation` will not work in this case, as it overrides only the attributes of the final derivation. It is for this reason that `overrideAttrs` should be preferred in (almost) all cases to `overrideDerivation`, i.e. to allow using `stdenv.mkDerivation` to process input arguments, as well as the fact that it is easier to use (you can use the same attribute names you see in your Nix code, instead of the ones generated (e.g. `buildInputs` vs `nativeBuildInputs`), and it involves less typing). +::: + +## <pkg>.overrideDerivation {#sec-pkg-overrideDerivation} + +::: warning +You should prefer `overrideAttrs` in almost all cases, see its documentation for the reasons why. `overrideDerivation` is not deprecated and will continue to work, but is less nice to use and does not have as many abilities as `overrideAttrs`. +::: + +::: warning +Do not use this function in Nixpkgs as it evaluates a Derivation before modifying it, which breaks package abstraction and removes error-checking of function arguments. In addition, this evaluation-per-function application incurs a performance penalty, which can become a problem if many overrides are used. It is only intended for ad-hoc customisation, such as in `~/.config/nixpkgs/config.nix`. +::: + +The function `overrideDerivation` creates a new derivation based on an existing one by overriding the original's attributes with the attribute set produced by the specified function. This function is available on all derivations defined using the `makeOverridable` function. Most standard derivation-producing functions, such as `stdenv.mkDerivation`, are defined using this function, which means most packages in the nixpkgs expression, `pkgs`, have this function. + +Example usage: + +```nix +mySed = pkgs.gnused.overrideDerivation (oldAttrs: { + name = "sed-4.2.2-pre"; + src = fetchurl { + url = ftp://alpha.gnu.org/gnu/sed/sed-4.2.2-pre.tar.bz2; + sha256 = "11nq06d131y4wmf3drm0yk502d2xc6n5qy82cg88rb9nqd2lj41k"; + }; + patches = []; +}); +``` + +In the above example, the `name`, `src`, and `patches` of the derivation will be overridden, while all other attributes will be retained from the original derivation. + +The argument `oldAttrs` is used to refer to the attribute set of the original derivation. + +::: note +A package's attributes are evaluated *before* being modified by the `overrideDerivation` function. For example, the `name` attribute reference in `url = "mirror://gnu/hello/${name}.tar.gz";` is filled-in *before* the `overrideDerivation` function modifies the attribute set. This means that overriding the `name` attribute, in this example, *will not* change the value of the `url` attribute. Instead, we need to override both the `name` *and* `url` attributes. +::: + +## lib.makeOverridable {#sec-lib-makeOverridable} + +The function `lib.makeOverridable` is used to make the result of a function easily customizable. This utility only makes sense for functions that accept an argument set and return an attribute set. + +Example usage: + +```nix +f = { a, b }: { result = a+b; }; +c = lib.makeOverridable f { a = 1; b = 2; }; +``` + +The variable `c` is the value of the `f` function applied with some default arguments. Hence the value of `c.result` is `3`, in this example. + +The variable `c` however also has some additional functions, like +[c.override](#sec-pkg-override) which can be used to override the +default arguments. In this example the value of +`(c.override { a = 4; }).result` is 6. diff --git a/doc/using/overrides.xml b/doc/using/overrides.xml deleted file mode 100644 index c9d36ddb2d7b..000000000000 --- a/doc/using/overrides.xml +++ /dev/null @@ -1,145 +0,0 @@ - - Overriding - - Sometimes one wants to override parts of nixpkgs, e.g. derivation attributes, the results of derivations. - - - These functions are used to make changes to packages, returning only single packages. Overlays, on the other hand, can be used to combine the overridden packages across the entire package set of Nixpkgs. - -
- <pkg>.override - - - The function override is usually available for all the derivations in the nixpkgs expression (pkgs). - - - - It is used to override the arguments passed to a function. - - - - Example usages: -pkgs.foo.override { arg1 = val1; arg2 = val2; ... } - - -import pkgs.path { overlays = [ (self: super: { - foo = super.foo.override { barSupport = true ; }; - })]}; - - -mypkg = pkgs.callPackage ./mypkg.nix { - mydep = pkgs.mydep.override { ... }; - } - - - - - In the first example, pkgs.foo is the result of a function call with some default arguments, usually a derivation. Using pkgs.foo.override will call the same function with the given new arguments. - -
-
- <pkg>.overrideAttrs - - - The function overrideAttrs allows overriding the attribute set passed to a stdenv.mkDerivation call, producing a new derivation based on the original one. This function is available on all derivations produced by the stdenv.mkDerivation function, which is most packages in the nixpkgs expression pkgs. - - - - Example usage: - -helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec { - separateDebugInfo = true; -}); - - - - - In the above example, the separateDebugInfo attribute is overridden to be true, thus building debug info for helloWithDebug, while all other attributes will be retained from the original hello package. - - - - The argument oldAttrs is conventionally used to refer to the attr set originally passed to stdenv.mkDerivation. - - - - - Note that separateDebugInfo is processed only by the stdenv.mkDerivation function, not the generated, raw Nix derivation. Thus, using overrideDerivation will not work in this case, as it overrides only the attributes of the final derivation. It is for this reason that overrideAttrs should be preferred in (almost) all cases to overrideDerivation, i.e. to allow using stdenv.mkDerivation to process input arguments, as well as the fact that it is easier to use (you can use the same attribute names you see in your Nix code, instead of the ones generated (e.g. buildInputs vs nativeBuildInputs), and it involves less typing). - - -
-
- <pkg>.overrideDerivation - - - - You should prefer overrideAttrs in almost all cases, see its documentation for the reasons why. overrideDerivation is not deprecated and will continue to work, but is less nice to use and does not have as many abilities as overrideAttrs. - - - - - - Do not use this function in Nixpkgs as it evaluates a Derivation before modifying it, which breaks package abstraction and removes error-checking of function arguments. In addition, this evaluation-per-function application incurs a performance penalty, which can become a problem if many overrides are used. It is only intended for ad-hoc customisation, such as in ~/.config/nixpkgs/config.nix. - - - - - The function overrideDerivation creates a new derivation based on an existing one by overriding the original's attributes with the attribute set produced by the specified function. This function is available on all derivations defined using the makeOverridable function. Most standard derivation-producing functions, such as stdenv.mkDerivation, are defined using this function, which means most packages in the nixpkgs expression, pkgs, have this function. - - - - Example usage: - -mySed = pkgs.gnused.overrideDerivation (oldAttrs: { - name = "sed-4.2.2-pre"; - src = fetchurl { - url = ftp://alpha.gnu.org/gnu/sed/sed-4.2.2-pre.tar.bz2; - sha256 = "11nq06d131y4wmf3drm0yk502d2xc6n5qy82cg88rb9nqd2lj41k"; - }; - patches = []; -}); - - - - - In the above example, the name, src, and patches of the derivation will be overridden, while all other attributes will be retained from the original derivation. - - - - The argument oldAttrs is used to refer to the attribute set of the original derivation. - - - - - A package's attributes are evaluated *before* being modified by the overrideDerivation function. For example, the name attribute reference in url = "mirror://gnu/hello/${name}.tar.gz"; is filled-in *before* the overrideDerivation function modifies the attribute set. This means that overriding the name attribute, in this example, *will not* change the value of the url attribute. Instead, we need to override both the name *and* url attributes. - - -
-
- lib.makeOverridable - - - The function lib.makeOverridable is used to make the result of a function easily customizable. This utility only makes sense for functions that accept an argument set and return an attribute set. - - - - Example usage: - -f = { a, b }: { result = a+b; }; -c = lib.makeOverridable f { a = 1; b = 2; }; - - - - - The variable c is the value of the f function applied with some default arguments. Hence the value of c.result is 3, in this example. - - - - The variable c however also has some additional functions, like c.override which can be used to override the default arguments. In this example the value of (c.override { a = 4; }).result is 6. - -
-
From c30fe2412047927ea761bdca20d42f7fc398745c Mon Sep 17 00:00:00 2001 From: fricklerhandwerk Date: Sat, 24 Apr 2021 11:12:46 +0200 Subject: [PATCH 02/13] docs/using: shellSession -> ShellSession Co-authored-by: Jan Tojnar --- doc/using/configuration.chapter.md | 10 +++++----- doc/using/overlays.chapter.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/using/configuration.chapter.md b/doc/using/configuration.chapter.md index e4d401368796..932b24237c02 100644 --- a/doc/using/configuration.chapter.md +++ b/doc/using/configuration.chapter.md @@ -42,7 +42,7 @@ There are two ways to try compiling a package which has been marked as broken. - For allowing the build of a broken package once, you can use an environment variable for a single invocation of the nix tools: - ```shellSession + ```ShellSession $ export NIXPKGS_ALLOW_BROKEN=1 ``` @@ -61,7 +61,7 @@ There are also two ways to try compiling a package which has been marked as unsu - For allowing the build of an unsupported package once, you can use an environment variable for a single invocation of the nix tools: - ```shellSession + ```ShellSession $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 ``` @@ -81,7 +81,7 @@ There are several ways to tweak how Nix handles a package which has been marked - To temporarily allow all unfree packages, you can use an environment variable for a single invocation of the nix tools: - ```shellSession + ```ShellSession $ export NIXPKGS_ALLOW_UNFREE=1 ``` @@ -134,7 +134,7 @@ There are several ways to tweak how Nix handles a package which has been marked - To temporarily allow all insecure packages, you can use an environment variable for a single invocation of the nix tools: - ```shellSession + ```ShellSession $ export NIXPKGS_ALLOW_INSECURE=1 ``` @@ -294,7 +294,7 @@ This provides us with some useful documentation for using our packages. However For this to work fully, you must also have this script sourced when you are logged in. Try adding something like this to your `~/.profile` file: -```shellSession +```ShellSession #!/bin/sh if [ -d $HOME/.nix-profile/etc/profile.d ]; then for i in $HOME/.nix-profile/etc/profile.d/*.sh; do diff --git a/doc/using/overlays.chapter.md b/doc/using/overlays.chapter.md index 935583a91e24..21efe467b847 100644 --- a/doc/using/overlays.chapter.md +++ b/doc/using/overlays.chapter.md @@ -111,7 +111,7 @@ self: super: This overlay uses Intel's MKL library for both BLAS and LAPACK interfaces. Note that the same can be accomplished at runtime using `LD_LIBRARY_PATH` of `libblas.so.3` and `liblapack.so.3`. For instance: -```shellSession +```ShellSession $ LD_LIBRARY_PATH=$(nix-build -A mkl)/lib:$LD_LIBRARY_PATH nix-shell -p octave --run octave ``` From 0418760037f2aef5e67beccbb1fe58b0fe4d7370 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Fri, 25 Dec 2020 15:05:53 -0700 Subject: [PATCH 03/13] ovftool: init at 4.4.1 --- pkgs/tools/virtualization/ovftool/default.nix | 230 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 232 insertions(+) create mode 100644 pkgs/tools/virtualization/ovftool/default.nix diff --git a/pkgs/tools/virtualization/ovftool/default.nix b/pkgs/tools/virtualization/ovftool/default.nix new file mode 100644 index 000000000000..cc4af17b47d0 --- /dev/null +++ b/pkgs/tools/virtualization/ovftool/default.nix @@ -0,0 +1,230 @@ +{ lib, stdenv, system ? builtins.currentSystem, ovftoolBundles ? {} +, requireFile, buildFHSUserEnv, patchelf, autoPatchelfHook, makeWrapper, nix, unzip +, glibc, c-ares, openssl_1_0_2, curl, expat, icu60, xercesc, zlib +}: + +let + version = "4.4.1-16812187"; + + # FHS environment required to unpack ovftool on x86. + ovftoolX86Unpacker = buildFHSUserEnv rec { + name = "ovftool-unpacker"; + targetPkgs = pkgs: [ pkgs.bash ]; + multiPkgs = targetPkgs; + runScript = "bash"; + }; + + # unpackPhase for i686 and x86_64 ovftool self-extracting bundles. + ovftoolX86UnpackPhase = '' + runHook preUnpack + + # This is a self-extracting shell script and needs a FHS environment to run. + # In reality, it could be doing anything, which is bad for reproducibility. + # Our postUnpack uses nix-hash to verify the hash to prevent problems. + # + # Note that the Arch PKGBUILD at + # https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vmware-ovftool + # appears to use xvfb-run - this hasn't been proven necessary so far. + # + cp ${ovftoolSource} ./ovftool.bundle + chmod +x ./ovftool.bundle + ${ovftoolX86Unpacker}/bin/ovftool-unpacker ./ovftool.bundle -x ovftool + rm ovftool.bundle + + local extracted=ovftool/vmware-ovftool/ + if [ -d "$extracted" ]; then + # Move the directory we care about to ovftool/ + mv "$extracted" . + rm -r ovftool + mv "$(basename -- "$extracted")" ovftool + echo "ovftool extracted successfully" >&2 + else + echo "Could not find $extracted - are you sure this is ovftool?" >&2 + rm -r ovftool + exit 1 + fi + + runHook postUnpack + ''; + + # unpackPhase for aarch64 .zip. + ovftoolAarch64UnpackPhase = '' + runHook preUnpack + + unzip ${ovftoolSource} + + local extracted=ovftool/ + if [ -d "$extracted" ]; then + echo "ovftool extracted successfully" >&2 + else + echo "Could not find $extracted - are you sure this is ovftool?" >&2 + exit 1 + fi + + runHook postUnpack + ''; + + # When the version is bumped, postUnpackHash will change + # for all these supported systems. Update it from the printed error on build. + # + # This is just a sanity check, since ovftool is a self-extracting bundle + # that could be doing absolutely anything on 2/3 of the supported platforms. + ovftoolSystems = { + "i686-linux" = { + filename = "VMware-ovftool-${version}-lin.i386.bundle"; + sha256 = "0gx78g3s77mmpir7jbiskna10i6262ihal1ywivlb6xxxxbhqzwj"; + unpackPhase = ovftoolX86UnpackPhase; + postUnpackHash = "1k8rp8ywhs0cl9aad37v1p0493bdvkxrsvwg5pgv2bhvjs4hqk7n"; + }; + "x86_64-linux" = { + filename = "VMware-ovftool-${version}-lin.x86_64.bundle"; + sha256 = "1kp2bp4d9i8y7q25yqff2bn62mh292lws7b66lyn8ka9b35kvnzc"; + unpackPhase = ovftoolX86UnpackPhase; + postUnpackHash = "0zvyakwi4iishqxxisihgh91bmdsfvj5vchm2c192hia03a143py"; + }; + "aarch64-linux" = { + filename = "VMware-ovftool-${version}-lin.aarch64.zip"; + sha256 = "0all8bwv5p5adnzqvrly6nzmxmfpywvlbfr0finr4n100yv0v1xy"; + unpackPhase = ovftoolAarch64UnpackPhase; + postUnpackHash = "16vyyzrmryi8b7mrd6nxnhywvvj2pw0ban4qfiqfahw763fn6971"; + }; + }; + + ovftoolSystem = if builtins.hasAttr system ovftoolSystems then + ovftoolSystems.${system} + else throw "System '${system}' is unsupported by ovftool"; + + ovftoolSource = if builtins.hasAttr system ovftoolBundles then + ovftoolBundles.${system} + else + requireFile { + name = ovftoolSystem.filename; + url = "https://my.vmware.com/group/vmware/downloads/get-download?downloadGroup=OVFTOOL441"; + sha256 = ovftoolSystem.sha256; + }; +in +stdenv.mkDerivation rec { + pname = "ovftool"; + inherit version; + + src = ovftoolSource; + + buildInputs = [ + glibc + + # This is insecure, but we don't really have a way around it + # since ovftool depends on it. In theory we could ship their OpenSSL + # build... but that makes the reliance on an insecure library less obvious. + openssl_1_0_2 + + c-ares + (curl.override { openssl = openssl_1_0_2; }) + expat + icu60 + xercesc + zlib + ]; + + nativeBuildInputs = [ nix patchelf autoPatchelfHook makeWrapper unzip ]; + + sourceRoot = "."; + + unpackPhase = ovftoolSystem.unpackPhase; + + postUnpackHash = ovftoolSystem.postUnpackHash; + + # Expects a directory named 'ovftool'. Validates the postUnpackHash in + # ovftoolSystem. + postUnpack = '' + if [ -d ovftool ]; then + # Ensure we're in the staging directory + cd ovftool + fi + + # Verify the hash with nix-hash before proceeding to ensure reproducibility. + local ovftool_hash + ovftool_hash="$(nix-hash --type sha256 --base32 .)" + if [ "$ovftool_hash" != "$postUnpackHash" ]; then + echo "Expected hash: $postUnpackHash" >&2 + echo "Actual hash: $ovftool_hash" >&2 + echo "Could not verify post-unpack hash!" >&2 + exit 1 + fi + ''; + + # Expects a directory named 'ovftool' containing the ovftool install. + # Based on https://aur.archlinux.org/packages/vmware-ovftool/ + # with the addition of a libexec directory and a Nix-style binary wrapper. + installPhase = '' + runHook preInstall + + if [ -d ovftool ]; then + # Ensure we're in the staging directory + cd ovftool + fi + + # libraries + install -m 755 -d "$out/lib/$pname" + + # These all appear to be VMWare proprietary except for libgoogleurl. + # The rest of the libraries that the installer extracts are omitted here, + # and provided in buildInputs. + # + # FIXME: can we replace libgoogleurl? Possibly from Chromium? + # + install -m 644 -t "$out/lib/$pname" \ + libgoogleurl.so.59 \ + libssoclient.so \ + libvim-types.so libvmacore.so libvmomi.so + + # ovftool specifically wants 1.0.2 but our libcrypto is named 1.0.0 + ln -s "${openssl_1_0_2.out}/lib/libcrypto.so" \ + "$out/lib/$pname/libcrypto.so.1.0.2" + ln -s "${openssl_1_0_2.out}/lib/libssl.so" \ + "$out/lib/$pname/libssl.so.1.0.2" + + # libexec + install -m 755 -d "$out/libexec/$pname" + install -m 755 -t "$out/libexec/$pname" ovftool.bin + install -m 644 -t "$out/libexec/$pname" icudt44l.dat + + # libexec resources + for subdir in "certs" "env" "env/en" "schemas/DMTF" "schemas/vmware"; do + install -m 755 -d "$out/libexec/$pname/$subdir" + install -m 644 -t "$out/libexec/$pname/$subdir" "$subdir"/*.* + done + + # EULA/OSS files + install -m 755 -d "$out/share/licenses/$pname" + install -m 644 -t "$out/share/licenses/$pname" \ + "vmware.eula" "vmware-eula.rtf" "open_source_licenses.txt" + + # documentation files + install -m 755 -d "$out/share/doc/$pname" + install -m 644 -t "$out/share/doc/$pname" "README.txt" + + # binary wrapper; note that LC_CTYPE is defaulted to en_US.UTF-8 by + # VMWare's wrapper script. We use C.UTF-8 instead. + install -m 755 -d "$out/bin" + makeWrapper "$out/libexec/$pname/ovftool.bin" "$out/bin/ovftool" \ + --set-default LC_CTYPE C.UTF-8 \ + --prefix LD_LIBRARY_PATH : "$out/lib" + + runHook postInstall + ''; + + preFixup = '' + addAutoPatchelfSearchPath "$out/lib" + ''; + + dontBuild = true; + dontPatch = true; + dontConfigure = true; + + meta = with lib; { + description = "VMWare tools for working with OVF, OVA, and VMX images"; + license = licenses.unfree; + maintainers = with maintainers; [ numinit ]; + platforms = builtins.attrNames ovftoolSystems; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9d370bd80f83..9b226f8d445d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7339,6 +7339,8 @@ in otpw = callPackage ../os-specific/linux/otpw { }; + ovftool = callPackage ../tools/virtualization/ovftool { }; + overcommit = callPackage ../development/tools/overcommit { }; overmind = callPackage ../applications/misc/overmind { }; From 0963e0baca6d2e7575d4866605899646f5cb1a98 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sat, 22 May 2021 05:40:30 +0000 Subject: [PATCH 04/13] innernet: 1.2.0 -> 1.3.0 --- pkgs/tools/networking/innernet/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/innernet/default.nix b/pkgs/tools/networking/innernet/default.nix index 7a39c250ccf5..f260f1be5e04 100644 --- a/pkgs/tools/networking/innernet/default.nix +++ b/pkgs/tools/networking/innernet/default.nix @@ -2,15 +2,15 @@ rustPlatform.buildRustPackage rec { pname = "innernet"; - version = "1.2.0"; + version = "1.3.0"; src = fetchFromGitHub { owner = "tonarino"; repo = pname; rev = "v${version}"; - sha256 = "sha256-Z4F5RYPVgFiiDBg6lxILjAh/a/rL7IJBqHIJ/tQyLnE="; + sha256 = "sha256-WqUkl9NZMMQJknASadLJz3CslrplGuXLrlv6fiwWFoI="; }; - cargoSha256 = "sha256-WSkN5aXMgfqZJAV1b3elF7kwf2f5OpcntKSf8620YcY="; + cargoSha256 = "sha256-mexiI9EHL2L4RNXCk133vriI5IGpdxLVy6xnBIqEH30="; nativeBuildInputs = with llvmPackages; [ llvm From 51f861a25c2d80c955dc3139da31a3aef2f9d03b Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sat, 22 May 2021 11:50:52 +0000 Subject: [PATCH 05/13] cdogs-sdl: 0.11.1 -> 0.12.0 --- pkgs/games/cdogs-sdl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/games/cdogs-sdl/default.nix b/pkgs/games/cdogs-sdl/default.nix index 08af6bd74a80..30abb71a1296 100644 --- a/pkgs/games/cdogs-sdl/default.nix +++ b/pkgs/games/cdogs-sdl/default.nix @@ -13,13 +13,13 @@ stdenv.mkDerivation rec { pname = "cdogs"; - version = "0.11.1"; + version = "0.12.0"; src = fetchFromGitHub { repo = "cdogs-sdl"; owner = "cxong"; rev = version; - sha256 = "sha256-POioDqmbWj+lYATp/3v14FoKZfR9GjLQyHq3nwDOywA="; + sha256 = "sha256-qbMR7otsC+uz+9mwgFaD2Z5fC6rj8ueYG3KwpPiqL98="; }; postPatch = '' From b817777ed7f5c5ee7e8362e223bfe6409abfb30e Mon Sep 17 00:00:00 2001 From: Justinas Stankevicius Date: Mon, 17 May 2021 22:13:58 +0300 Subject: [PATCH 06/13] woeusb: 3.3.1 -> 5.1.0 --- pkgs/tools/misc/woeusb/default.nix | 43 ++++++++----------- .../tools/misc/woeusb/remove-workaround.patch | 15 ------- 2 files changed, 18 insertions(+), 40 deletions(-) delete mode 100644 pkgs/tools/misc/woeusb/remove-workaround.patch diff --git a/pkgs/tools/misc/woeusb/default.nix b/pkgs/tools/misc/woeusb/default.nix index a728afc388a5..ade752e09f66 100644 --- a/pkgs/tools/misc/woeusb/default.nix +++ b/pkgs/tools/misc/woeusb/default.nix @@ -1,45 +1,38 @@ -{ lib, stdenv, fetchFromGitHub, autoreconfHook, makeWrapper -, coreutils, dosfstools, findutils, gawk, gnugrep, grub2_light, ncurses, ntfs3g, parted, p7zip, util-linux, wget -, wxGTK30 }: +{ lib, stdenv, fetchFromGitHub, installShellFiles, makeWrapper +, coreutils, dosfstools, findutils, gawk, gnugrep, grub2_light, ncurses, ntfs3g, parted, p7zip, util-linux, wimlib, wget }: stdenv.mkDerivation rec { - version = "3.3.1"; + version = "5.1.0"; pname = "woeusb"; src = fetchFromGitHub { - owner = "slacka"; + owner = "WoeUSB"; repo = "WoeUSB"; rev = "v${version}"; - sha256 = "1hbr88sr943s4yqdvbny543jvgvnsa622wq4cmwd23hjsfcrvyiv"; + sha256 = "1qakk7lnj71m061rn72nabk4c37vw0vkx2a28xgxas8v8cwvkkam"; }; - patches = [ ./remove-workaround.patch ]; - - nativeBuildInputs = [ autoreconfHook makeWrapper ]; - buildInputs = [ wxGTK30 ]; + nativeBuildInputs = [ installShellFiles makeWrapper ]; postPatch = '' # Emulate version smudge filter (see .gitattributes, .gitconfig). - for file in configure.ac debian/changelog src/woeusb src/woeusb.1 src/woeusbgui.1; do + for file in sbin/woeusb share/man/man1/woeusb.1; do substituteInPlace "$file" \ --replace '@@WOEUSB_VERSION@@' '${version}' done - - substituteInPlace src/MainPanel.cpp \ - --replace "'woeusb " "'$out/bin/woeusb " ''; - postInstall = '' - # don't write data into / - substituteInPlace "$out/bin/woeusb" \ - --replace /media/ /run/woeusb/ + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + mv sbin/woeusb $out/bin + installManPage share/man/man1/woeusb.1 - # woeusbgui launches woeusb with pkexec, which sets - # PATH=/usr/sbin:/usr/bin:/sbin:/bin:/root/bin. Perhaps pkexec - # should be patched with a less useless default PATH, but for now - # we add everything we need manually. wrapProgram "$out/bin/woeusb" \ - --set PATH '${lib.makeBinPath [ coreutils dosfstools findutils gawk gnugrep grub2_light ncurses ntfs3g parted util-linux wget p7zip ]}' + --set PATH '${lib.makeBinPath [ coreutils dosfstools findutils gawk gnugrep grub2_light ncurses ntfs3g parted p7zip util-linux wget wimlib ]}' + + runHook postInstall ''; doInstallCheck = true; @@ -52,8 +45,8 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Create bootable USB disks from Windows ISO images"; - homepage = "https://github.com/slacka/WoeUSB"; - license = licenses.gpl3; + homepage = "https://github.com/WoeUSB/WoeUSB"; + license = licenses.gpl3Plus; maintainers = with maintainers; [ bjornfor ]; platforms = platforms.linux; }; diff --git a/pkgs/tools/misc/woeusb/remove-workaround.patch b/pkgs/tools/misc/woeusb/remove-workaround.patch deleted file mode 100644 index 3550002dfedd..000000000000 --- a/pkgs/tools/misc/woeusb/remove-workaround.patch +++ /dev/null @@ -1,15 +0,0 @@ -https://github.com/slacka/WoeUSB/issues/267 - -diff --git a/src/woeusb b/src/woeusb -index 8cb292c..c017dbf 100755 ---- a/src/woeusb -+++ b/src/woeusb -@@ -1661,6 +1661,8 @@ workaround_support_windows_7_uefi_boot(){ - ## - System lagging while copying data · Issue #113 · slacka/WoeUSB - ## - The pernicious USB-stick stall problem [LWN.net] - workaround_linux_make_writeback_buffering_not_suck(){ -+ return 0 -+ - util_check_function_parameters_quantity 1 "${#}" - local -r mode="${1}" - From 9cf6b9d681ba6f1afc181c16720692ad72d0891c Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Mon, 24 May 2021 19:27:29 +0000 Subject: [PATCH 07/13] mbuffer: 20210209 -> 20210328 --- pkgs/tools/misc/mbuffer/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/mbuffer/default.nix b/pkgs/tools/misc/mbuffer/default.nix index 2ab76e8dfd42..19bc784ae086 100644 --- a/pkgs/tools/misc/mbuffer/default.nix +++ b/pkgs/tools/misc/mbuffer/default.nix @@ -3,12 +3,12 @@ } : stdenv.mkDerivation rec { - version = "20210209"; + version = "20210328"; pname = "mbuffer"; src = fetchurl { url = "http://www.maier-komor.de/software/mbuffer/mbuffer-${version}.tgz"; - sha256 = "sha256-6B8niOJiHyD4SBge8ssZrG0SMoaRQ38wFXSyU/2Jmgw="; + sha256 = "sha256-UbW42EiJkaVf4d/OkBMPnke8HOKGugO09ijAS3hP3F0="; }; buildInputs = [ openssl ]; From 24a369cebd96548ccbde064e1b278ee4216d3fd7 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 26 May 2021 12:39:48 +0200 Subject: [PATCH 08/13] python3Packages.beancount: add google-auth dep --- pkgs/development/python-modules/beancount/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/beancount/default.nix b/pkgs/development/python-modules/beancount/default.nix index 88369f41872b..ec864e71498f 100644 --- a/pkgs/development/python-modules/beancount/default.nix +++ b/pkgs/development/python-modules/beancount/default.nix @@ -7,6 +7,7 @@ , chardet , dateutil , google-api-python-client +, google-auth-oauthlib , lxml , oauth2client , ply @@ -35,6 +36,7 @@ buildPythonPackage rec { chardet dateutil google-api-python-client + google-auth-oauthlib lxml oauth2client ply From abb9ea73f7b2bd8d0862be47a0a1010d7644136b Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Thu, 27 May 2021 14:09:02 +0200 Subject: [PATCH 09/13] nixos/tests/{sway,cagebreak}: Disable on aarch64-linux The tests timeout on AArch64 (e.g. [0] and [1]), likely because the QEMU option "-vga virtio" isn't supported there (unfortunately I currently lack access to an AArch64 system with NixOS to investigate). This also affects the test for Cage but that one is already limited to x86_64-linux. [0]: https://hydra.nixos.org/build/144148809 [1]: https://hydra.nixos.org/build/144103034 --- nixos/tests/all-tests.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 99393e5b1842..ed0dc0b8e6d0 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -53,7 +53,7 @@ in caddy = handleTest ./caddy.nix {}; cadvisor = handleTestOn ["x86_64-linux"] ./cadvisor.nix {}; cage = handleTestOn ["x86_64-linux"] ./cage.nix {}; - cagebreak = handleTest ./cagebreak.nix {}; + cagebreak = handleTestOn ["x86_64-linux"] ./cagebreak.nix {}; calibre-web = handleTest ./calibre-web.nix {}; cassandra_2_1 = handleTest ./cassandra.nix { testPackage = pkgs.cassandra_2_1; }; cassandra_2_2 = handleTest ./cassandra.nix { testPackage = pkgs.cassandra_2_2; }; @@ -395,7 +395,7 @@ in sssd-ldap = handleTestOn ["x86_64-linux"] ./sssd-ldap.nix {}; strongswan-swanctl = handleTest ./strongswan-swanctl.nix {}; sudo = handleTest ./sudo.nix {}; - sway = handleTest ./sway.nix {}; + sway = handleTestOn ["x86_64-linux"] ./sway.nix {}; switchTest = handleTest ./switch-test.nix {}; sympa = handleTest ./sympa.nix {}; syncthing = handleTest ./syncthing.nix {}; From 44c286d23663a5d3ef5c5b74b51b125a2dcd29ac Mon Sep 17 00:00:00 2001 From: Michael Adler Date: Fri, 21 May 2021 07:31:19 +0100 Subject: [PATCH 10/13] tree-sitter: 0.19.3 -> 0.19.5 new grammars: * tree-sitter-toml * tree-sitter-tsq * tree-sitter-zig --- .../development/tools/parsing/tree-sitter/default.nix | 6 +++--- .../tools/parsing/tree-sitter/grammars/default.nix | 3 +++ .../tree-sitter/grammars/tree-sitter-c-sharp.json | 8 ++++---- .../parsing/tree-sitter/grammars/tree-sitter-go.json | 8 ++++---- .../tree-sitter/grammars/tree-sitter-java.json | 8 ++++---- .../tree-sitter/grammars/tree-sitter-javascript.json | 8 ++++---- .../tree-sitter/grammars/tree-sitter-julia.json | 8 ++++---- .../parsing/tree-sitter/grammars/tree-sitter-nix.json | 8 ++++---- .../tree-sitter/grammars/tree-sitter-ocaml.json | 8 ++++---- .../parsing/tree-sitter/grammars/tree-sitter-php.json | 8 ++++---- .../tree-sitter/grammars/tree-sitter-toml.json | 10 ++++++++++ .../parsing/tree-sitter/grammars/tree-sitter-tsq.json | 10 ++++++++++ .../tree-sitter/grammars/tree-sitter-typescript.json | 8 ++++---- .../tree-sitter/grammars/tree-sitter-yaml.json | 8 ++++---- .../parsing/tree-sitter/grammars/tree-sitter-zig.json | 10 ++++++++++ pkgs/development/tools/parsing/tree-sitter/update.nix | 11 +++++++++++ 16 files changed, 87 insertions(+), 43 deletions(-) create mode 100644 pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-toml.json create mode 100644 pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-tsq.json create mode 100644 pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-zig.json diff --git a/pkgs/development/tools/parsing/tree-sitter/default.nix b/pkgs/development/tools/parsing/tree-sitter/default.nix index 29edf0f9f27c..6ab1463917c8 100644 --- a/pkgs/development/tools/parsing/tree-sitter/default.nix +++ b/pkgs/development/tools/parsing/tree-sitter/default.nix @@ -28,9 +28,9 @@ let # 1) change all these hashes # 2) nix-build -A tree-sitter.updater.update-all-grammars # 3) run the ./result script that is output by that (it updates ./grammars) - version = "0.19.3"; - sha256 = "0zd1p9x32bwdc5cdqr0x8i9fpcykk1zczb8zdjawrrr92465d26y"; - cargoSha256 = "1n63lxp8rknb5xqp02csj649cxs7d891a520djl3lb4k1finhsjj"; + version = "0.19.5"; + sha256 = "1qmb0sva28zv6r3c3j7xs9pc8bpwwhkb9vxxndw2zbdn9wkvmbmn"; + cargoSha256 = "0hnjik3pymb1s7frhfpfzvd6w2k3lgpsmh6milpriwxmqsmkwdzz"; src = fetchFromGitHub { owner = "tree-sitter"; diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix b/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix index d9d5fa46badc..e5eb3029c868 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix @@ -29,7 +29,10 @@ tree-sitter-scala = (builtins.fromJSON (builtins.readFile ./tree-sitter-scala.json)); tree-sitter-svelte = (builtins.fromJSON (builtins.readFile ./tree-sitter-svelte.json)); tree-sitter-swift = (builtins.fromJSON (builtins.readFile ./tree-sitter-swift.json)); + tree-sitter-toml = (builtins.fromJSON (builtins.readFile ./tree-sitter-toml.json)); + tree-sitter-tsq = (builtins.fromJSON (builtins.readFile ./tree-sitter-tsq.json)); tree-sitter-typescript = (builtins.fromJSON (builtins.readFile ./tree-sitter-typescript.json)); tree-sitter-verilog = (builtins.fromJSON (builtins.readFile ./tree-sitter-verilog.json)); tree-sitter-yaml = (builtins.fromJSON (builtins.readFile ./tree-sitter-yaml.json)); + tree-sitter-zig = (builtins.fromJSON (builtins.readFile ./tree-sitter-zig.json)); } diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c-sharp.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c-sharp.json index dd6a3a380bc6..148004de4657 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c-sharp.json +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c-sharp.json @@ -1,9 +1,9 @@ { "url": "https://github.com/tree-sitter/tree-sitter-c-sharp", - "rev": "09749b7b5428e770cc2ebdf2e90029c0f4a2d411", - "date": "2021-04-13T07:05:48+01:00", - "path": "/nix/store/w99nivk866bglvijxb5m0c789qh99x1m-tree-sitter-c-sharp", - "sha256": "17n7r1j1ib3gzjf0qw88512flzamjrvilksbf1p15dqa17rmwyq1", + "rev": "5b6bfbdcdbdda7da4839d7163ce579ed98410282", + "date": "2021-05-21T15:22:56+02:00", + "path": "/nix/store/msyjbgxf3y3rj6m3w2apd65cvr9x523r-tree-sitter-c-sharp", + "sha256": "0ls2qic3jb20zv4m5pdrc3ikfb66afay3krvc6gsq1fi9hbxrmvv", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-go.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-go.json index 6783d4381f6d..69d4869010f4 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-go.json +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-go.json @@ -1,9 +1,9 @@ { "url": "https://github.com/tree-sitter/tree-sitter-go", - "rev": "2a83dfdd759a632651f852aa4dc0af2525fae5cd", - "date": "2021-03-09T16:11:33-05:00", - "path": "/nix/store/2jk1bacllxsii8nlbc5lyi3k376ylf3q-tree-sitter-go", - "sha256": "001p8kb8g4vghn78690bnav42inkypld2k1mbd5pbmd5svvacfav", + "rev": "eb306e6e60f393df346cfc8cbfaf52667a37128a", + "date": "2021-05-04T14:03:16-07:00", + "path": "/nix/store/xgi4w5by155m1zqhqf2s7hmngy6sxdq3-tree-sitter-go", + "sha256": "03x3nkjxdfck9a4z2i50wq065vixqqk4v5w6fnd870q63v0zrc7c", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-java.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-java.json index c3e5cb9d20f2..0856320ef59b 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-java.json +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-java.json @@ -1,9 +1,9 @@ { "url": "https://github.com/tree-sitter/tree-sitter-java", - "rev": "ee8e358637e05188f9f65d8d1ad88a4412c975ce", - "date": "2021-04-20T10:40:14-04:00", - "path": "/nix/store/8612qackwqdsvbfc03lzc5vds6mvqwxf-tree-sitter-java", - "sha256": "19qxfimy8w49gqc97siknd27kvkz73qp2v2118pvdbdz7c5dv27r", + "rev": "2efe37f92d2e6aeb25186e9da07455bb4a30163c", + "date": "2021-05-04T14:05:05-07:00", + "path": "/nix/store/bzljwaraqj6zqpq85cz9xb0vwh7c10yj-tree-sitter-java", + "sha256": "09v3xg1356ghc2n0yi8iqkp80lbkav0jpfgz8iz2j1sl7ihbvkyw", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-javascript.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-javascript.json index 351a0f262cb0..c0411d15fb69 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-javascript.json +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-javascript.json @@ -1,9 +1,9 @@ { "url": "https://github.com/tree-sitter/tree-sitter-javascript", - "rev": "a263a8f53266f8f0e47e21598e488f0ef365a085", - "date": "2021-04-20T10:37:09-04:00", - "path": "/nix/store/y6qbdzdx4g1g1sa2rb7dnk9snjs6lhpp-tree-sitter-javascript", - "sha256": "04s1jb9c96kwq0nrh6516idlh58d2b1k66amqa2sl5kk32pl9pmm", + "rev": "6c8cfae935f67dd9e3a33982e5e06be0ece6399a", + "date": "2021-05-11T09:51:32-07:00", + "path": "/nix/store/dhh1gz45l3h3p31jfg5fgy1kns1lbw6d-tree-sitter-javascript", + "sha256": "1mw6miw4yp6s1i0b08hflamfvrjdim4fnnj6fy461n05jp1s1i78", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-julia.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-julia.json index d90f09348cad..ef319a1e33d7 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-julia.json +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-julia.json @@ -1,9 +1,9 @@ { "url": "https://github.com/tree-sitter/tree-sitter-julia", - "rev": "0ba7a24b062b671263ae08e707e9e94383b25bb7", - "date": "2021-03-04T14:52:13-08:00", - "path": "/nix/store/2ni8p1cgyrkn1mcccl4zqdpkfm63a10m-tree-sitter-julia", - "sha256": "1pbnmvhy2gq4vg1b0sjzmjm4s2gsgdjh7h01yj8qrrqbcl29c463", + "rev": "12ea597262125fc22fd2e91aa953ac69b19c26ca", + "date": "2021-05-03T17:44:45-07:00", + "path": "/nix/store/lbz23r698hn7cha09qq0dbfay7dh74gg-tree-sitter-julia", + "sha256": "0rmd7k3rv567psxrlqv17gvckijs19xs6mxni045rpayxmk441sk", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-nix.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-nix.json index eb97bb46f685..ff638a08baf0 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-nix.json +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-nix.json @@ -1,9 +1,9 @@ { "url": "https://github.com/cstrahan/tree-sitter-nix", - "rev": "d5287aac195ab06da4fe64ccf93a76ce7c918445", - "date": "2021-04-21T19:11:29-05:00", - "path": "/nix/store/6labzn2qd3wyn4k2ddb09z2avpgqwbp1-tree-sitter-nix", - "sha256": "0mapqdqrinskdxlarrrvyd55mjg97gbd6jm9vbjmdm4xi2hhzvxa", + "rev": "50f38ceab667f9d482640edfee803d74f4edeba5", + "date": "2021-04-27T17:21:51-05:00", + "path": "/nix/store/fhf3mvxg17g0xli59cgmmwqy4g21fbzj-tree-sitter-nix", + "sha256": "11gifb9b7x9v223hsrcb6wlkqpxbc4p5v4ny9aixzi9k8g0jhb3d", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ocaml.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ocaml.json index 941a96646843..fe6b149e0409 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ocaml.json +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ocaml.json @@ -1,9 +1,9 @@ { "url": "https://github.com/tree-sitter/tree-sitter-ocaml", - "rev": "2f962cf4eb0bee87bba755347a79ee501cd58313", - "date": "2021-03-11T02:13:42+01:00", - "path": "/nix/store/pwf6di3pdghsnb83c87vvm3w0d5aanvp-tree-sitter-ocaml", - "sha256": "1dfan7kbs7i0nz9dkxv8ipn0b341j1fr9fn0a2zfqsx6xxkra56r", + "rev": "0348562f385bc2bd67ecf181425e1afd6d454192", + "date": "2021-05-07T21:05:16+02:00", + "path": "/nix/store/s2499rsi28k0nrwx8wl2idsp86zsx2iz-tree-sitter-ocaml", + "sha256": "0iqmwcz3c2ai4gyx4xli1rhn6hi6a0f60dn20f8jas9ham9dc2df", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-php.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-php.json index a536d54b651c..4ff38790b6f7 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-php.json +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-php.json @@ -1,9 +1,9 @@ { "url": "https://github.com/tree-sitter/tree-sitter-php", - "rev": "4dcc061668fbc68b79421c72eb8a8baeeb0f3693", - "date": "2021-04-19T12:44:47-04:00", - "path": "/nix/store/2i80zds4dbynrdim9ngc8yp6yn825byb-tree-sitter-php", - "sha256": "0hs6dfw9n6sp7vbp7zfid0f0sxydyya3dyp5ghckz7al069g3vx2", + "rev": "6a271f4075e11815e787df9055a950fb844ee63b", + "date": "2021-05-13T12:41:22+02:00", + "path": "/nix/store/n6hycd1scxa990xchk5h09ilxi7w18f5-tree-sitter-php", + "sha256": "1ijxc6brd0d35hr89ic8k5ispc6sj4mxln7bznd9n6zrgjvfdjqb", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-toml.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-toml.json new file mode 100644 index 000000000000..a3d9bedd133b --- /dev/null +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-toml.json @@ -0,0 +1,10 @@ +{ + "url": "https://github.com/ikatyang/tree-sitter-toml", + "rev": "8bd2056818b21860e3d756b5a58c4f6e05fb744e", + "date": "2021-05-11T12:47:32+08:00", + "path": "/nix/store/isgpadcxmgkb14w9yg67pb8lx7wlfhnn-tree-sitter-toml", + "sha256": "0yasw5fp4mq6vzrdwlc3dxlss8a94bsffv4mzrfp0b3iw0s1dlyg", + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-tsq.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-tsq.json new file mode 100644 index 000000000000..918e87b38a42 --- /dev/null +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-tsq.json @@ -0,0 +1,10 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-tsq", + "rev": "b665659d3238e6036e22ed0e24935e60efb39415", + "date": "2021-05-18T15:57:40-04:00", + "path": "/nix/store/j59y4s3bsv6d5nbmhhdgb043hmk8157k-tree-sitter-tsq", + "sha256": "03bch2wp2jwxk69zjplvm0gbyw06qqdy7il9qkiafvhrbh03ayd9", + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-typescript.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-typescript.json index a59dd9a0004a..04ad785f76f9 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-typescript.json +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-typescript.json @@ -1,9 +1,9 @@ { "url": "https://github.com/tree-sitter/tree-sitter-typescript", - "rev": "82916165120f840164f11119f268a4de819ea90b", - "date": "2021-04-19T18:16:19-07:00", - "path": "/nix/store/0c0kkiiamms3yl3mf1clyrqcjwp5j920-tree-sitter-typescript", - "sha256": "1jnf0hn6hmn4x2cvy29mk8g1wlp0afs8immp461by3q5hcq8fzb4", + "rev": "28e757a2f498486931b3cb13a100a1bcc9261456", + "date": "2021-05-04T14:04:30-07:00", + "path": "/nix/store/d90hgv5g374a6mrwhq9vcxk6d6lp2ags-tree-sitter-typescript", + "sha256": "0dxy5h68hhypzq0z15q8iawjgw3kx7dlpw76zv6xkxh25idqgxqh", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-yaml.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-yaml.json index c8544d7dbec3..8959c80f9f48 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-yaml.json +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-yaml.json @@ -1,9 +1,9 @@ { "url": "https://github.com/ikatyang/tree-sitter-yaml", - "rev": "6129a83eeec7d6070b1c0567ec7ce3509ead607c", - "date": "2021-04-18T14:25:59+08:00", - "path": "/nix/store/8wrwm71z9flfk00phrh9aaxpvsrw1m67-tree-sitter-yaml", - "sha256": "1bimf5fq85wn8dwlk665w15n2bj37fma5rsfxrph3i9yb0lvzi3q", + "rev": "0e36bed171768908f331ff7dff9d956bae016efb", + "date": "2021-05-11T12:47:24+08:00", + "path": "/nix/store/7d7m4zs4ydnwbn3xnfm3pvpy7gvkrmg8-tree-sitter-yaml", + "sha256": "0wyvjh62zdp5bhd2y8k7k7x4wz952l55i1c8d94rhffsbbf9763f", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false diff --git a/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-zig.json b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-zig.json new file mode 100644 index 000000000000..97774bc58f61 --- /dev/null +++ b/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-zig.json @@ -0,0 +1,10 @@ +{ + "url": "https://github.com/GrayJack/tree-sitter-zig", + "rev": "41bbc7f7b94bde3e948e41e4d42673945238ff03", + "date": "2021-03-30T12:55:10-03:00", + "path": "/nix/store/av4xgzr3c1rhr7v4fa9mm68krd2qv1lg-tree-sitter-zig", + "sha256": "0gjxac43qpqc4332bp3mpdbvh7rqv0q3hvw8834b30ml5q0r0qr0", + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/pkgs/development/tools/parsing/tree-sitter/update.nix b/pkgs/development/tools/parsing/tree-sitter/update.nix index c55858b5ff15..168c9a0a403d 100644 --- a/pkgs/development/tools/parsing/tree-sitter/update.nix +++ b/pkgs/development/tools/parsing/tree-sitter/update.nix @@ -35,6 +35,7 @@ let "tree-sitter-jsdoc" "tree-sitter-ql" "tree-sitter-embedded-template" + "tree-sitter-tsq" ]; knownTreeSitterOrgGrammarReposJson = jsonFile "known-tree-sitter-org-grammar-repos" knownTreeSitterOrgGrammarRepos; @@ -60,6 +61,8 @@ let "tree-sitter.github.io" # not maintained "tree-sitter-razor" + # rust library for constructing arbitrary graph structures from source code + "tree-sitter-graph" ]; ignoredTreeSitterOrgReposJson = jsonFile "ignored-tree-sitter-org-repos" ignoredTreeSitterOrgRepos; @@ -91,6 +94,14 @@ let orga = "ikatyang"; repo = "tree-sitter-yaml"; }; + "tree-sitter-toml" = { + orga = "ikatyang"; + repo = "tree-sitter-toml"; + }; + "tree-sitter-zig" = { + orga = "GrayJack"; + repo = "tree-sitter-zig"; + }; }; allGrammars = From d8638f1c7f57ab06e11575ac80868c9adeee4068 Mon Sep 17 00:00:00 2001 From: remedialchaos Date: Thu, 27 May 2021 20:34:02 +0530 Subject: [PATCH 11/13] pmbootstrap: init at 1.30.0 (#118444) Co-authored-by: Sandro --- pkgs/tools/misc/pmbootstrap/default.nix | 95 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 97 insertions(+) create mode 100644 pkgs/tools/misc/pmbootstrap/default.nix diff --git a/pkgs/tools/misc/pmbootstrap/default.nix b/pkgs/tools/misc/pmbootstrap/default.nix new file mode 100644 index 000000000000..3f75e8e33af0 --- /dev/null +++ b/pkgs/tools/misc/pmbootstrap/default.nix @@ -0,0 +1,95 @@ +{ lib, git, openssl, makeWrapper, buildPythonApplication, pytestCheckHook, ps +, fetchPypi, fetchFromGitLab }: + +buildPythonApplication rec { + pname = "pmbootstrap"; + version = "1.30.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-uHN3nplQOMuBeQIxAocCVqwnmJUQZL67+iXLhQ7onps="; + }; + + repo = fetchFromGitLab { + domain = "gitlab.com"; + owner = "postmarketOS"; + repo = pname; + rev = version; + sha256 = "sha256-JunI/mqq+UvmzNVt3mdJN3+tKGN4uTrxkUU2imCNCNY="; + }; + + pmb_test = "${repo}/test"; + + checkInputs = [ pytestCheckHook git openssl ps ]; + + # Add test dependency in PATH + checkPhase = "export PYTHONPATH=$PYTHONPATH:${pmb_test}"; + + # skip impure tests + disabledTests = [ + "test_get_apkbuild" + "test_check_build_for_arch" + "test_get_depends" + "test_build_depends_no_binary_error" + "test_build_depends_binary_outdated" + "test_init_buildenv" + "test_run_abuild" + "test_finish" + "test_package" + "test_build_depends_high_level" + "test_build_local_source_high_level" + "test_chroot_interactive_shell" + "test_chroot_interactive_shell_user" + "test_chroot_arguments" + "test_switch_to_channel_branch" + "test_read_config_channel" + "test_cross_compile_distcc" + "test_build_src_invalid_path" + "test_can_fast_forward" + "test_clean_worktree" + "test_get_upstream_remote" + "test_pull" + "test_helpers_package_get_apkindex" + "test_filter_missing_packages_invalid" + "test_filter_missing_packages_binary_exists" + "test_filter_missing_packages_pmaports" + "test_filter_aport_packages" + "test_pmbootstrap_status" + "test_print_checks_git_repo" + "test_helpers_ui" + "test_newapkbuild" + "test_package_from_aports" + "test_recurse_invalid" + "test_questions_bootimg" + "test_questions_keymaps" + "test_questions_work_path" + "test_questions_channel" + "test_apk_static" + "test_aportgen" + "test_aportgen_device_wizard" + "test_bootimg" + "test_build_is_necessary" + "test_config_user" + "test_crossdirect" + "test_file" + "test_folder_size" + "test_helpers_lint" + "test_helpers_repo" + "test_kconfig_check" + "test_keys" + "test_pkgrel_bump" + "test_qemu_running_processes" + "test_run_core" + "test_shell_escape" + "test_version" + ]; + + makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ git openssl ]}" ]; + + meta = with lib; { + description = "Sophisticated chroot/build/flash tool to develop and install postmarketOS"; + homepage = "https://gitlab.com/postmarketOS/pmbootstrap"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ payas ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e11b6b25933f..c77d3652187b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24188,6 +24188,8 @@ in pixelnuke = callPackage ../applications/graphics/pixelnuke { }; + pmbootstrap = python3Packages.callPackage ../tools/misc/pmbootstrap/default.nix { }; + slack = callPackage ../applications/networking/instant-messengers/slack { }; slack-cli = callPackage ../tools/networking/slack-cli { }; From 15eb917faf7ddab6d7ab8a17cf72a425eff898e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 27 May 2021 17:04:19 +0200 Subject: [PATCH 12/13] diff-so-fancy: 1.4.0 -> 1.4.1 --- .../git-and-tools/diff-so-fancy/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/git-and-tools/diff-so-fancy/default.nix b/pkgs/applications/version-management/git-and-tools/diff-so-fancy/default.nix index a1daf3db4487..77ad7d8658d1 100644 --- a/pkgs/applications/version-management/git-and-tools/diff-so-fancy/default.nix +++ b/pkgs/applications/version-management/git-and-tools/diff-so-fancy/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "diff-so-fancy"; - version = "1.4.0"; + version = "1.4.1"; src = fetchFromGitHub { owner = "so-fancy"; repo = "diff-so-fancy"; rev = "v${version}"; - sha256 = "sha256-//n7kOANVHRSjxclxDcMnpMVzUcd/U6fFsP8acRjVWA="; + sha256 = "sha256-bV22x459QerWg4MVLWsXPDhM38QWG6BE+dVmKIFfDiE="; }; nativeBuildInputs = [ From 8ed03bc71243f642a5d47cfc9b84b0592cf5d158 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 27 May 2021 10:35:24 -0500 Subject: [PATCH 13/13] kubernetes-helm: 3.5.4 -> 3.6.0 --- pkgs/applications/networking/cluster/helm/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/cluster/helm/default.nix b/pkgs/applications/networking/cluster/helm/default.nix index 0508830918fd..e861ef97be35 100644 --- a/pkgs/applications/networking/cluster/helm/default.nix +++ b/pkgs/applications/networking/cluster/helm/default.nix @@ -2,15 +2,15 @@ buildGoModule rec { pname = "helm"; - version = "3.5.4"; + version = "3.6.0"; src = fetchFromGitHub { owner = "helm"; repo = "helm"; rev = "v${version}"; - sha256 = "sha256-u8GJVOubPlIG88TFG5+OvbovMz4Q595wWo2YCwuTgG8="; + sha256 = "sha256-sVa7d69MuOjH1IhUMcXu79kEE0BKylLYx6yrOV/DExY="; }; - vendorSha256 = "sha256-zdZxGiwgx8c0zt9tQebJi7k/LNNYjhNInsVeBbxPsgE="; + vendorSha256 = "sha256-PTAyRG6PZK+vaiheUd3oiu4iBGlnFjoCrci0CYbXjBk="; doCheck = false;