Merge remote-tracking branch 'origin/staging' into HEAD
This commit is contained in:
+13
-2
@@ -49,11 +49,16 @@
|
||||
/pkgs/build-support/writers @lassulus @Profpatsch
|
||||
|
||||
# Nixpkgs documentation
|
||||
/doc @fricklerhandwerk
|
||||
/maintainers/scripts/db-to-md.sh @jtojnar @ryantm
|
||||
/maintainers/scripts/doc @jtojnar @ryantm
|
||||
|
||||
/doc/* @fricklerhandwerk
|
||||
/doc/build-aux/pandoc-filters @jtojnar
|
||||
/doc/contributing/contributing-to-documentation.chapter.md @jtojnar
|
||||
/doc/builders/trivial-builders.chapter.md @fricklerhandwerk
|
||||
/doc/contributing/ @fricklerhandwerk
|
||||
/doc/contributing/contributing-to-documentation.chapter.md @jtojnar @fricklerhandwerk
|
||||
/doc/stdenv @fricklerhandwerk
|
||||
/doc/using @fricklerhandwerk
|
||||
|
||||
# NixOS Internals
|
||||
/nixos/default.nix @nbp @infinisil
|
||||
@@ -187,6 +192,7 @@
|
||||
/nixos/modules/services/networking/babeld.nix @mweinelt
|
||||
/nixos/modules/services/networking/kea.nix @mweinelt
|
||||
/nixos/modules/services/networking/knot.nix @mweinelt
|
||||
/nixos/modules/services/monitoring/prometheus/exporters/kea.nix @mweinelt
|
||||
/nixos/tests/babeld.nix @mweinelt
|
||||
/nixos/tests/kea.nix @mweinelt
|
||||
/nixos/tests/knot.nix @mweinelt
|
||||
@@ -288,3 +294,8 @@
|
||||
# Dotnet
|
||||
/pkgs/build-support/dotnet @IvarWithoutBones
|
||||
/pkgs/development/compilers/dotnet @IvarWithoutBones
|
||||
|
||||
# Node.js
|
||||
/pkgs/build-support/node/build-npm-package @winterqt
|
||||
/pkgs/build-support/node/fetch-npm-deps @winterqt
|
||||
/doc/languages-frameworks/javascript.section.md @winterqt
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: Unreproducible package
|
||||
about: A package that does not produce a bit-by-bit reproducible result each time it is built
|
||||
title: ''
|
||||
labels: '0.kind: enhancement', '6.topic: reproducible builds'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Building this package twice does not produce the bit-by-bit identical result each time, making it harder to detect CI breaches. You can read more about this at https://reproducible-builds.org/ .
|
||||
|
||||
Fixing bit-by-bit reproducibility also has additional advantages, such as avoiding hard-to-reproduce bugs, making content-addressed storage more effective and reducing rebuilds in such systems.
|
||||
|
||||
### Steps To Reproduce
|
||||
|
||||
```
|
||||
nix-build '<nixpkgs>' -A ... --check --keep-failed
|
||||
```
|
||||
|
||||
You can use `diffoscope` to analyze the differences in the output of the two builds.
|
||||
|
||||
To view the build log of the build that produced the artifact in the binary cache:
|
||||
|
||||
```
|
||||
nix-store --read-log $(nix-instantiate '<nixpkgs>' -A ...)
|
||||
```
|
||||
|
||||
### Additional context
|
||||
|
||||
(please share the relevant fragment of the diffoscope output here,
|
||||
and any additional analysis you may have done)
|
||||
@@ -0,0 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
@@ -19,8 +19,8 @@ jobs:
|
||||
# we don't limit this action to only NixOS repo since the checks are cheap and useful developer feedback
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/cachix-action@v10
|
||||
- uses: cachix/install-nix-action@v18
|
||||
- uses: cachix/cachix-action@v12
|
||||
with:
|
||||
# This cache is for the nixpkgs repo checks and should not be trusted or used elsewhere.
|
||||
name: nixpkgs-ci
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
id: ismerge
|
||||
run: |
|
||||
ISMERGE=$(curl -H 'Accept: application/vnd.github.groot-preview+json' -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ env.GITHUB_REPOSITORY }}/commits/${{ env.GITHUB_SHA }}/pulls | jq -r '.[] | select(.merge_commit_sha == "${{ env.GITHUB_SHA }}") | any')
|
||||
echo "::set-output name=ismerge::$ISMERGE"
|
||||
echo "ismerge=$ISMERGE" >> $GITHUB_OUTPUT
|
||||
# github events are eventually consistent, so wait until changes propagate to thier DB
|
||||
- run: sleep 60
|
||||
if: steps.ismerge.outputs.ismerge != 'true'
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
with:
|
||||
# pull_request_target checks out the base branch by default
|
||||
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/install-nix-action@v18
|
||||
with:
|
||||
# nixpkgs commit is pinned so that it doesn't break
|
||||
# editorconfig-checker 2.4.0
|
||||
|
||||
@@ -18,11 +18,11 @@ jobs:
|
||||
with:
|
||||
# pull_request_target checks out the base branch by default
|
||||
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/install-nix-action@v18
|
||||
with:
|
||||
# explicitly enable sandbox
|
||||
extra_nix_config: sandbox = true
|
||||
- uses: cachix/cachix-action@v10
|
||||
- uses: cachix/cachix-action@v12
|
||||
with:
|
||||
# This cache is for the nixpkgs repo checks and should not be trusted or used elsewhere.
|
||||
name: nixpkgs-ci
|
||||
|
||||
@@ -18,11 +18,11 @@ jobs:
|
||||
with:
|
||||
# pull_request_target checks out the base branch by default
|
||||
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/install-nix-action@v18
|
||||
with:
|
||||
# explicitly enable sandbox
|
||||
extra_nix_config: sandbox = true
|
||||
- uses: cachix/cachix-action@v10
|
||||
- uses: cachix/cachix-action@v12
|
||||
with:
|
||||
# This cache is for the nixpkgs repo checks and should not be trusted or used elsewhere.
|
||||
name: nixpkgs-ci
|
||||
|
||||
@@ -18,11 +18,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/install-nix-action@v18
|
||||
with:
|
||||
# explicitly enable sandbox
|
||||
extra_nix_config: sandbox = true
|
||||
- uses: cachix/cachix-action@v10
|
||||
- uses: cachix/cachix-action@v12
|
||||
with:
|
||||
# This cache is for the nixpkgs repo checks and should not be trusted or used elsewhere.
|
||||
name: nixpkgs-ci
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
with:
|
||||
# pull_request_target checks out the base branch by default
|
||||
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/install-nix-action@v18
|
||||
- name: Check DocBook files generated from Markdown are consistent
|
||||
run: |
|
||||
nixos/doc/manual/md-to-db.sh
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
name: "Set pending OfBorg status"
|
||||
on:
|
||||
pull_request_target:
|
||||
|
||||
# Sets the ofborg-eval status to "pending" to signal that we are waiting for
|
||||
# OfBorg even if it is running late. The status will be overwritten by OfBorg
|
||||
# once it starts evaluation.
|
||||
|
||||
# WARNING:
|
||||
# When extending this action, be aware that $GITHUB_TOKEN allows (restricted) write access to
|
||||
# the GitHub repository. This means that it should not evaluate user input in a
|
||||
# way that allows code injection.
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
action:
|
||||
if: github.repository_owner == 'NixOS'
|
||||
permissions:
|
||||
statuses: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Set pending OfBorg status"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
curl \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: Bearer $GITHUB_TOKEN" \
|
||||
-d '{"context": "ofborg-eval", "state": "pending", "description": "Waiting for OfBorg..."}' \
|
||||
"https://api.github.com/repos/NixOS/nixpkgs/commits/${{ github.event.pull_request.head.sha }}/statuses"
|
||||
@@ -1,26 +0,0 @@
|
||||
name: "clear pending status"
|
||||
|
||||
on:
|
||||
check_suite:
|
||||
types: [ completed ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
action:
|
||||
permissions:
|
||||
statuses: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: clear pending status
|
||||
if: github.repository_owner == 'NixOS' && github.event.check_suite.app.name == 'OfBorg'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
curl \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-d '{"state": "success", "target_url": " ", "description": " ", "context": "Wait for ofborg"}' \
|
||||
"https://api.github.com/repos/NixOS/nixpkgs/statuses/${{ github.event.check_suite.head_sha }}"
|
||||
@@ -1,30 +0,0 @@
|
||||
name: "set pending status"
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
|
||||
# WARNING:
|
||||
# When extending this action, be aware that $GITHUB_TOKEN allows write access to
|
||||
# the GitHub repository. This means that it should not evaluate user input in a
|
||||
# way that allows code injection.
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
action:
|
||||
permissions:
|
||||
statuses: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: set pending status
|
||||
if: github.repository_owner == 'NixOS'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
curl \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-d '{"state": "pending", "target_url": " ", "description": "This pending status will be cleared when ofborg starts eval.", "context": "Wait for ofborg"}' \
|
||||
"https://api.github.com/repos/NixOS/nixpkgs/statuses/${{ github.event.pull_request.head.sha }}"
|
||||
@@ -17,13 +17,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/install-nix-action@v18
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixpkgs-unstable
|
||||
- name: setup
|
||||
id: setup
|
||||
run: |
|
||||
echo ::set-output name=title::"terraform-providers: update $(date -u +"%Y-%m-%d")"
|
||||
echo "title=terraform-providers: update $(date -u +"%Y-%m-%d")" >> $GITHUB_OUTPUT
|
||||
- name: update terraform-providers
|
||||
run: |
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
@@ -34,6 +34,8 @@ jobs:
|
||||
--argstr keep-going true \
|
||||
--argstr max-workers 2 \
|
||||
--argstr path terraform-providers
|
||||
- name: clean repo
|
||||
run: |
|
||||
git clean -f
|
||||
- name: create PR
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
@@ -41,6 +43,8 @@ jobs:
|
||||
body: |
|
||||
Automatic update by [update-terraform-providers](https://github.com/NixOS/nixpkgs/blob/master/.github/workflows/update-terraform-providers.yml) action.
|
||||
|
||||
https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}
|
||||
|
||||
Check that all providers build with:
|
||||
```
|
||||
@ofborg build terraform.full
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
Daniel Løvbrøtte Olsen <me@dandellion.xyz> <daniel.olsen99@gmail.com>
|
||||
R. RyanTM <ryantm-bot@ryantm.com>
|
||||
Sandro <sandro.jaeckel@gmail.com>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--[[
|
||||
Converts some HTML elements commonly used in Markdown to corresponding DocBook elements.
|
||||
]]
|
||||
|
||||
function RawInline(elem)
|
||||
if elem.format == 'html' and elem.text == '<kbd>' then
|
||||
return pandoc.RawInline('docbook', '<keycap>')
|
||||
elseif elem.format == 'html' and elem.text == '</kbd>' then
|
||||
return pandoc.RawInline('docbook', '</keycap>')
|
||||
end
|
||||
end
|
||||
@@ -15,7 +15,7 @@ This allows using Nix to build images which can be run on many recent Linux dist
|
||||
The primary tool for interacting with Portable Services is `portablectl`,
|
||||
and they are managed by the `systemd-portabled` system service.
|
||||
|
||||
:::{.note}
|
||||
::: {.note}
|
||||
Portable services are supported starting with systemd 239 (released on 2018-06-22).
|
||||
:::
|
||||
|
||||
@@ -37,7 +37,7 @@ dependencies of the two derivations in the `units` list.
|
||||
`units` must be a list of derivations, and their names must be prefixed with the service name (`"demo"` in this case).
|
||||
Otherwise `systemd-portabled` will ignore them.
|
||||
|
||||
:::{.Note}
|
||||
::: {.note}
|
||||
The `.raw` file extension of the image is required by the portable services specification.
|
||||
:::
|
||||
|
||||
@@ -76,6 +76,6 @@ portablectl attach demo_1.0.raw
|
||||
systemctl enable --now demo.socket
|
||||
systemctl enable --now demo.service
|
||||
```
|
||||
:::{.Note}
|
||||
::: {.note}
|
||||
See the [man page](https://www.freedesktop.org/software/systemd/man/portablectl.html) of `portablectl` for more info on its usage.
|
||||
:::
|
||||
|
||||
@@ -480,15 +480,23 @@ Preferred source hash type is sha256. There are several ways to get it.
|
||||
|
||||
4. Extracting hash from local source tarball can be done with `sha256sum`. Use `nix-prefetch-url file:///path/to/tarball` if you want base32 hash.
|
||||
|
||||
5. Fake hash: set fake hash in package expression, perform build and extract correct hash from error Nix prints.
|
||||
5. Fake hash: set the hash to one of
|
||||
|
||||
For package updates it is enough to change one symbol to make hash fake. For new packages, you can use `lib.fakeSha256`, `lib.fakeSha512` or any other fake hash.
|
||||
- `""`
|
||||
- `lib.fakeHash`
|
||||
- `lib.fakeSha256`
|
||||
- `lib.fakeSha512`
|
||||
|
||||
in the package expression, attempt build and extract correct hash from error messages.
|
||||
|
||||
::: {.warning}
|
||||
You must use one of these four fake hashes and not some arbitrarily-chosen hash.
|
||||
|
||||
See [](#sec-source-hashes-security).
|
||||
:::
|
||||
|
||||
This is last resort method when reconstructing source URL is non-trivial and `nix-prefetch-url -A` isn’t applicable (for example, [one of `kodi` dependencies](https://github.com/NixOS/nixpkgs/blob/d2ab091dd308b99e4912b805a5eb088dd536adb9/pkgs/applications/video/kodi/default.nix#L73)). The easiest way then would be replace hash with a fake one and rebuild. Nix build will fail and error message will contain desired hash.
|
||||
|
||||
::: {.warning}
|
||||
This method has security problems. Check below for details.
|
||||
:::
|
||||
|
||||
### Obtaining hashes securely {#sec-source-hashes-security}
|
||||
|
||||
@@ -500,7 +508,7 @@ Let's say Man-in-the-Middle (MITM) sits close to your network. Then instead of f
|
||||
|
||||
- `https://` URLs are secure in methods 1, 2, 3;
|
||||
|
||||
- `https://` URLs are not secure in method 5. When obtaining hashes with fake hash method, TLS checks are disabled. So refetch source hash from several different networks to exclude MITM scenario. Alternatively, use fake hash method to make Nix error, but instead of extracting hash from error, extract `https://` URL and prefetch it with method 1.
|
||||
- `https://` URLs are secure in method 5 *only if* you use one of the listed fake hashes. If you use any other hash, `fetchurl` will pass `--insecure` to `curl` and may then degrade to HTTP in case of TLS certificate expiration.
|
||||
|
||||
## Patches {#sec-patches}
|
||||
|
||||
|
||||
@@ -302,6 +302,12 @@ Container system, boot system and library changes are some examples of the pull
|
||||
|
||||
It is possible for community members that have enough knowledge and experience on a special topic to contribute by merging pull requests.
|
||||
|
||||
In case the PR is stuck waiting for the original author to apply a trivial
|
||||
change (a typo, capitalisation change, etc.) and the author allowed the members
|
||||
to modify the PR, consider applying it yourself. (or commit the existing review
|
||||
suggestion) You should pay extra attention to make sure the addition doesn't go
|
||||
against the idea of the original PR and would not be opposed by the author.
|
||||
|
||||
<!--
|
||||
The following paragraphs about how to deal with unactive contributors is just a proposition and should be modified to what the community agrees to be the right policy.
|
||||
|
||||
|
||||
@@ -244,12 +244,16 @@ The `master` branch is the main development branch. It should only see non-break
|
||||
|
||||
The `staging` branch is a development branch where mass-rebuilds go. Mass rebuilds are commits that cause rebuilds for many packages, like more than 500 (or perhaps, if it's 'light' packages, 1000). It should only see non-breaking mass-rebuild commits. That means it is not to be used for testing, and changes must have been well tested already. If the branch is already in a broken state, please refrain from adding extra new breakages.
|
||||
|
||||
During the process of a releasing a new NixOS version, this branch or the release-critical packages can be restricted to non-breaking changes.
|
||||
|
||||
### Staging-next branch {#submitting-changes-staging-next-branch}
|
||||
|
||||
The `staging-next` branch is for stabilizing mass-rebuilds submitted to the `staging` branch prior to merging them into `master`. Mass-rebuilds must go via the `staging` branch. It must only see non-breaking commits that are fixing issues blocking it from being merged into the `master` branch.
|
||||
|
||||
If the branch is already in a broken state, please refrain from adding extra new breakages. Stabilize it for a few days and then merge into master.
|
||||
|
||||
During the process of a releasing a new NixOS version, this branch or the release-critical packages can be restricted to non-breaking changes.
|
||||
|
||||
### Stable release branches {#submitting-changes-stable-release-branches}
|
||||
|
||||
The same staging workflow applies to stable release branches, but the main branch is called `release-*` instead of `master`.
|
||||
|
||||
@@ -22,6 +22,7 @@ with pkgs; stdenv.mkDerivation {
|
||||
docgen lists 'List manipulation functions'
|
||||
docgen debug 'Debugging functions'
|
||||
docgen options 'NixOS / nixpkgs option handling'
|
||||
docgen filesystem 'Filesystem functions'
|
||||
docgen sources 'Source filtering functions'
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -26,5 +26,7 @@
|
||||
|
||||
<xi:include href="./library/generated/options.xml" />
|
||||
|
||||
<xi:include href="./library/generated/filesystem.xml" />
|
||||
|
||||
<xi:include href="./library/generated/sources.xml" />
|
||||
</section>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### Autoconf {#setup-hook-autoconf}
|
||||
|
||||
The `autoreconfHook` derivation adds `autoreconfPhase`, which runs autoreconf, libtoolize and automake, essentially preparing the configure script in autotools-based builds. Most autotools-based packages come with the configure script pre-generated, but this hook is necessary for a few packages and when you need to patch the package’s configure scripts.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### Automake {#setup-hook-automake}
|
||||
|
||||
Adds the `share/aclocal` subdirectory of each build input to the `ACLOCAL_PATH` environment variable.
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
### autoPatchelfHook {#setup-hook-autopatchelfhook}
|
||||
|
||||
This is a special setup hook which helps in packaging proprietary software in that it automatically tries to find missing shared library dependencies of ELF files based on the given `buildInputs` and `nativeBuildInputs`.
|
||||
|
||||
You can also specify a `runtimeDependencies` variable which lists dependencies to be unconditionally added to rpath of all executables. This is useful for programs that use dlopen 3 to load libraries at runtime.
|
||||
|
||||
In certain situations you may want to run the main command (`autoPatchelf`) of the setup hook on a file or a set of directories instead of unconditionally patching all outputs. This can be done by setting the `dontAutoPatchelf` environment variable to a non-empty value.
|
||||
|
||||
By default `autoPatchelf` will fail as soon as any ELF file requires a dependency which cannot be resolved via the given build inputs. In some situations you might prefer to just leave missing dependencies unpatched and continue to patch the rest. This can be achieved by setting the `autoPatchelfIgnoreMissingDeps` environment variable to a non-empty value. `autoPatchelfIgnoreMissingDeps` can be set to a list like `autoPatchelfIgnoreMissingDeps = [ "libcuda.so.1" "libcudart.so.1" ];` or to simply `[ "*" ]` to ignore all missing dependencies.
|
||||
|
||||
The `autoPatchelf` command also recognizes a `--no-recurse` command line flag, which prevents it from recursing into subdirectories.
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
### breakpointHook {#breakpointhook}
|
||||
|
||||
This hook will make a build pause instead of stopping when a failure happens. It prevents nix from cleaning up the build environment immediately and allows the user to attach to a build environment using the `cntr` command. Upon build error it will print instructions on how to use `cntr`, which can be used to enter the environment for debugging. Installing cntr and running the command will provide shell access to the build sandbox of failed build. At `/var/lib/cntr` the sandboxed filesystem is mounted. All commands and files of the system are still accessible within the shell. To execute commands from the sandbox use the cntr exec subcommand. `cntr` is only supported on Linux-based platforms. To use it first add `cntr` to your `environment.systemPackages` on NixOS or alternatively to the root user on non-NixOS systems. Then in the package that is supposed to be inspected, add `breakpointHook` to `nativeBuildInputs`.
|
||||
|
||||
```nix
|
||||
nativeBuildInputs = [ breakpointHook ];
|
||||
```
|
||||
|
||||
When a build failure happens there will be an instruction printed that shows how to attach with `cntr` to the build sandbox.
|
||||
|
||||
::: {.note}
|
||||
::: {.title}
|
||||
Caution with remote builds
|
||||
:::
|
||||
|
||||
This won’t work with remote builds as the build environment is on a different machine and can’t be accessed by `cntr`. Remote builds can be turned off by setting `--option builders ''` for `nix-build` or `--builders ''` for `nix build`.
|
||||
:::
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### cmake {#cmake}
|
||||
|
||||
Overrides the default configure phase to run the CMake command. By default, we use the Make generator of CMake. In addition, dependencies are added automatically to `CMAKE_PREFIX_PATH` so that packages are correctly detected by CMake. Some additional flags are passed in to give similar behavior to configure-based packages. You can disable this hook’s behavior by setting `configurePhase` to a custom value, or by setting `dontUseCmakeConfigure`. `cmakeFlags` controls flags passed only to CMake. By default, parallel building is enabled as CMake supports parallel building almost everywhere. When Ninja is also in use, CMake will detect that and use the ninja generator.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### gdk-pixbuf {#setup-hook-gdk-pixbuf}
|
||||
|
||||
Exports `GDK_PIXBUF_MODULE_FILE` environment variable to the builder. Add librsvg package to `buildInputs` to get svg support. See also the [setup hook description in GNOME platform docs](#ssec-gnome-hooks-gdk-pixbuf).
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### GHC {#ghc}
|
||||
|
||||
Creates a temporary package database and registers every Haskell build input in it (TODO: how?).
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### GNOME platform {#gnome-platform}
|
||||
|
||||
Hooks related to GNOME platform and related libraries like GLib, GTK and GStreamer are described in [](#sec-language-gnome).
|
||||
@@ -6,5 +6,32 @@
|
||||
<para>
|
||||
Nixpkgs has several hook packages that augment the stdenv phases.
|
||||
</para>
|
||||
<para>
|
||||
The stdenv built-in hooks are documented in <xref linkend="ssec-setup-hooks"/>.
|
||||
</para>
|
||||
<xi:include href="./autoconf.section.xml" />
|
||||
<xi:include href="./automake.section.xml" />
|
||||
<xi:include href="./autopatchelf.section.xml" />
|
||||
<xi:include href="./breakpoint.section.xml" />
|
||||
<xi:include href="./cmake.section.xml" />
|
||||
<xi:include href="./gdk-pixbuf.section.xml" />
|
||||
<xi:include href="./ghc.section.xml" />
|
||||
<xi:include href="./gnome.section.xml" />
|
||||
<xi:include href="./installShellFiles.section.xml" />
|
||||
<xi:include href="./libiconv.section.xml" />
|
||||
<xi:include href="./libxml2.section.xml" />
|
||||
<xi:include href="./meson.section.xml" />
|
||||
<xi:include href="./ninja.section.xml" />
|
||||
<xi:include href="./patch-rc-path-hooks.section.xml" />
|
||||
<xi:include href="./perl.section.xml" />
|
||||
<xi:include href="./pkg-config.section.xml" />
|
||||
<xi:include href="./postgresql-test-hook.section.xml" />
|
||||
<xi:include href="./python.section.xml" />
|
||||
<xi:include href="./qt-4.section.xml" />
|
||||
<xi:include href="./scons.section.xml" />
|
||||
<xi:include href="./tetex-tex-live.section.xml" />
|
||||
<xi:include href="./unzip.section.xml" />
|
||||
<xi:include href="./validatePkgConfig.section.xml" />
|
||||
<xi:include href="./waf.section.xml" />
|
||||
<xi:include href="./xcbuild.section.xml" />
|
||||
</chapter>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
### `installShellFiles` {#installshellfiles}
|
||||
|
||||
This hook helps with installing manpages and shell completion files. It exposes 2 shell functions `installManPage` and `installShellCompletion` that can be used from your `postInstall` hook.
|
||||
|
||||
The `installManPage` function takes one or more paths to manpages to install. The manpages must have a section suffix, and may optionally be compressed (with `.gz` suffix). This function will place them into the correct directory.
|
||||
|
||||
The `installShellCompletion` function takes one or more paths to shell completion files. By default it will autodetect the shell type from the completion file extension, but you may also specify it by passing one of `--bash`, `--fish`, or `--zsh`. These flags apply to all paths listed after them (up until another shell flag is given). Each path may also have a custom installation name provided by providing a flag `--name NAME` before the path. If this flag is not provided, zsh completions will be renamed automatically such that `foobar.zsh` becomes `_foobar`. A root name may be provided for all paths using the flag `--cmd NAME`; this synthesizes the appropriate name depending on the shell (e.g. `--cmd foo` will synthesize the name `foo.bash` for bash and `_foo` for zsh). The path may also be a fifo or named fd (such as produced by `<(cmd)`), in which case the shell and name must be provided.
|
||||
|
||||
```nix
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
postInstall = ''
|
||||
installManPage doc/foobar.1 doc/barfoo.3
|
||||
# explicit behavior
|
||||
installShellCompletion --bash --name foobar.bash share/completions.bash
|
||||
installShellCompletion --fish --name foobar.fish share/completions.fish
|
||||
installShellCompletion --zsh --name _foobar share/completions.zsh
|
||||
# implicit behavior
|
||||
installShellCompletion share/completions/foobar.{bash,fish,zsh}
|
||||
# using named fd
|
||||
installShellCompletion --cmd foobar \
|
||||
--bash <($out/bin/foobar --bash-completion) \
|
||||
--fish <($out/bin/foobar --fish-completion) \
|
||||
--zsh <($out/bin/foobar --zsh-completion)
|
||||
'';
|
||||
```
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### libiconv, libintl {#libiconv-libintl}
|
||||
|
||||
A few libraries automatically add to `NIX_LDFLAGS` their library, making their symbols automatically available to the linker. This includes libiconv and libintl (gettext). This is done to provide compatibility between GNU Linux, where libiconv and libintl are bundled in, and other systems where that might not be the case. Sometimes, this behavior is not desired. To disable this behavior, set `dontAddExtraLibs`.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### libxml2 {#setup-hook-libxml2}
|
||||
|
||||
Adds every file named `catalog.xml` found under the `xml/dtd` and `xml/xsl` subdirectories of each build input to the `XML_CATALOG_FILES` environment variable.
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
### Meson {#meson}
|
||||
|
||||
Overrides the configure phase to run meson to generate Ninja files. To run these files, you should accompany Meson with ninja. By default, `enableParallelBuilding` is enabled as Meson supports parallel building almost everywhere.
|
||||
|
||||
#### Variables controlling Meson {#variables-controlling-meson}
|
||||
|
||||
##### `mesonFlags` {#mesonflags}
|
||||
|
||||
Controls the flags passed to meson.
|
||||
|
||||
##### `mesonBuildType` {#mesonbuildtype}
|
||||
|
||||
Which [`--buildtype`](https://mesonbuild.com/Builtin-options.html#core-options) to pass to Meson. We default to `plain`.
|
||||
|
||||
##### `mesonAutoFeatures` {#mesonautofeatures}
|
||||
|
||||
What value to set [`-Dauto_features=`](https://mesonbuild.com/Builtin-options.html#core-options) to. We default to `enabled`.
|
||||
|
||||
##### `mesonWrapMode` {#mesonwrapmode}
|
||||
|
||||
What value to set [`-Dwrap_mode=`](https://mesonbuild.com/Builtin-options.html#core-options) to. We default to `nodownload` as we disallow network access.
|
||||
|
||||
##### `dontUseMesonConfigure` {#dontusemesonconfigure}
|
||||
|
||||
Disables using Meson’s `configurePhase`.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### ninja {#ninja}
|
||||
|
||||
Overrides the build, install, and check phase to run ninja instead of make. You can disable this behavior with the `dontUseNinjaBuild`, `dontUseNinjaInstall`, and `dontUseNinjaCheck`, respectively. Parallel building is enabled by default in Ninja.
|
||||
@@ -0,0 +1,50 @@
|
||||
|
||||
# `patchRcPath` hooks {#sec-patchRcPathHooks}
|
||||
|
||||
These hooks provide shell-specific utilities (with the same name as the hook) to patch shell scripts meant to be sourced by software users.
|
||||
|
||||
The typical usage is to patch initialisation or [rc](https://unix.stackexchange.com/questions/3467/what-does-rc-in-bashrc-stand-for) scripts inside `$out/bin` or `$out/etc`.
|
||||
Such scripts, when being sourced, would insert the binary locations of certain commands into `PATH`, modify other environment variables or run a series of start-up commands.
|
||||
When shipped from the upstream, they sometimes use commands that might not be available in the environment they are getting sourced in.
|
||||
|
||||
The compatible shells for each hook are:
|
||||
|
||||
- `patchRcPathBash`: [Bash](https://www.gnu.org/software/bash/), [ksh](http://www.kornshell.org/), [zsh](https://www.zsh.org/) and other shells supporting the Bash-like parameter expansions.
|
||||
- `patchRcPathCsh`: Csh scripts, such as those targeting [tcsh](https://www.tcsh.org/).
|
||||
- `patchRcPathFish`: [Fish](https://fishshell.com/) scripts.
|
||||
- `patchRcPathPosix`: POSIX-conformant shells supporting the limited parameter expansions specified by the POSIX standard. Current implementation uses the parameter expansion `${foo-}` only.
|
||||
|
||||
For each supported shell, it modifies the script with a `PATH` prefix that is later removed when the script ends.
|
||||
It allows nested patching, which guarantees that a patched script may source another patched script.
|
||||
|
||||
Syntax to apply the utility to a script:
|
||||
|
||||
```sh
|
||||
patchRcPath<shell> <file> <PATH-prefix>
|
||||
```
|
||||
|
||||
Example usage:
|
||||
|
||||
Given a package `foo` containing an init script `this-foo.fish` that depends on `coreutils`, `man` and `which`,
|
||||
patch the init script for users to source without having the above dependencies in their `PATH`:
|
||||
|
||||
```nix
|
||||
{ lib, stdenv, patchRcPathFish}:
|
||||
stdenv.mkDerivation {
|
||||
|
||||
# ...
|
||||
|
||||
nativeBuildInputs = [
|
||||
patchRcPathFish
|
||||
];
|
||||
|
||||
postFixup = ''
|
||||
patchRcPathFish $out/bin/this-foo.fish ${lib.makeBinPath [ coreutils man which ]}
|
||||
'';
|
||||
}
|
||||
```
|
||||
|
||||
::: {.note}
|
||||
`patchRcPathCsh` and `patchRcPathPosix` implementation depends on `sed` to do the string processing.
|
||||
The others are in vanilla shell and have no third-party dependencies.
|
||||
:::
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### Perl {#setup-hook-perl}
|
||||
|
||||
Adds the `lib/site_perl` subdirectory of each build input to the `PERL5LIB` environment variable. For instance, if `buildInputs` contains Perl, then the `lib/site_perl` subdirectory of each input is added to the `PERL5LIB` environment variable.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### pkg-config {#setup-hook-pkg-config}
|
||||
|
||||
Adds the `lib/pkgconfig` and `share/pkgconfig` subdirectories of each build input to the `PKG_CONFIG_PATH` environment variable.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### Python {#setup-hook-python}
|
||||
|
||||
Adds the `lib/${python.libPrefix}/site-packages` subdirectory of each build input to the `PYTHONPATH` environment variable.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### Qt 4 {#qt-4}
|
||||
|
||||
Sets the `QTDIR` environment variable to Qt’s path.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### scons {#scons}
|
||||
|
||||
Overrides the build, install, and check phases. This uses the scons build system as a replacement for make. scons does not provide a configure phase, so everything is managed at build and install time.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### teTeX / TeX Live {#tetex-tex-live}
|
||||
|
||||
Adds the `share/texmf-nix` subdirectory of each build input to the `TEXINPUTS` environment variable.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### unzip {#unzip}
|
||||
|
||||
This setup hook will allow you to unzip .zip files specified in `$src`. There are many similar packages like `unrar`, `undmg`, etc.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### validatePkgConfig {#validatepkgconfig}
|
||||
|
||||
The `validatePkgConfig` hook validates all pkg-config (`.pc`) files in a package. This helps catching some common errors in pkg-config files, such as undefined variables.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### wafHook {#wafhook}
|
||||
|
||||
Overrides the configure, build, and install phases. This will run the “waf” script used by many projects. If `wafPath` (default `./waf`) doesn’t exist, it will copy the version of waf available in Nixpkgs. `wafFlags` can be used to pass flags to the waf script.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
### xcbuildHook {#xcbuildhook}
|
||||
|
||||
Overrides the build and install phases to run the "xcbuild" command. This hook is needed when a project only comes with build files for the XCode build system. You can disable this behavior by setting buildPhase and configurePhase to a custom value. xcbuildFlags controls flags passed only to xcbuild.
|
||||
@@ -157,6 +157,61 @@ git config --global url."https://github.com/".insteadOf git://github.com/
|
||||
|
||||
## Tool specific instructions {#javascript-tool-specific}
|
||||
|
||||
### buildNpmPackage {#javascript-buildNpmPackage}
|
||||
|
||||
`buildNpmPackage` allows you to package npm-based projects in Nixpkgs without the use of an auto-generated dependencies file (as used in [node2nix](#javascript-node2nix)). It works by utilizing npm's cache functionality -- creating a reproducible cache that contains the dependencies of a project, and pointing npm to it.
|
||||
|
||||
```nix
|
||||
{ lib, buildNpmPackage, fetchFromGitHub }:
|
||||
|
||||
buildNpmPackage rec {
|
||||
pname = "flood";
|
||||
version = "4.7.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jesec";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-BR+ZGkBBfd0dSQqAvujsbgsEPFYw/ThrylxUbOksYxM=";
|
||||
};
|
||||
|
||||
patches = [ ./remove-prepack-script.patch ];
|
||||
|
||||
npmDepsHash = "sha256-s8SpZY/1tKZVd3vt7sA9vsqHvEaNORQBMrSyhWpj048=";
|
||||
|
||||
NODE_OPTIONS = "--openssl-legacy-provider";
|
||||
|
||||
meta = with lib; {
|
||||
description = "A modern web UI for various torrent clients with a Node.js backend and React frontend";
|
||||
homepage = "https://flood.js.org";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ winter ];
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
#### Arguments {#javascript-buildNpmPackage-arguments}
|
||||
|
||||
* `npmDepsHash`: The output hash of the dependencies for this project. Can be calculated in advance with [`prefetch-npm-deps`](#javascript-buildNpmPackage-prefetch-npm-deps).
|
||||
* `makeCacheWritable`: Whether to make the cache writable prior to installing dependencies. Don't set this unless npm tries to write to the cache directory, as it can slow down the build.
|
||||
* `npmBuildScript`: The script to run to build the project. Defaults to `"build"`.
|
||||
* `npmFlags`: Flags to pass to all npm commands.
|
||||
* `npmInstallFlags`: Flags to pass to `npm ci`.
|
||||
* `npmBuildFlags`: Flags to pass to `npm run ${npmBuildScript}`.
|
||||
* `npmPackFlags`: Flags to pass to `npm pack`.
|
||||
|
||||
#### prefetch-npm-deps {#javascript-buildNpmPackage-prefetch-npm-deps}
|
||||
|
||||
`prefetch-npm-deps` can calculate the hash of the dependencies of an npm project ahead of time.
|
||||
|
||||
```console
|
||||
$ ls
|
||||
package.json package-lock.json index.js
|
||||
$ prefetch-npm-deps package-lock.json
|
||||
...
|
||||
sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
|
||||
```
|
||||
|
||||
### node2nix {#javascript-node2nix}
|
||||
|
||||
#### Preparation {#javascript-node2nix-preparation}
|
||||
|
||||
@@ -200,7 +200,7 @@ luaposix = buildLuarocksPackage {
|
||||
The `buildLuarocksPackage` delegates most tasks to luarocks:
|
||||
|
||||
* it adds `luarocks` as an unpacker for `src.rock` files (zip files really).
|
||||
* configurePhase` writes a temporary luarocks configuration file which location
|
||||
* `configurePhase` writes a temporary luarocks configuration file which location
|
||||
is exported via the environment variable `LUAROCKS_CONFIG`.
|
||||
* the `buildPhase` does nothing.
|
||||
* `installPhase` calls `luarocks make --deps-mode=none --tree $out` to build and
|
||||
|
||||
@@ -1670,9 +1670,9 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul
|
||||
|
||||
```nix
|
||||
nixpkgs.config.packageOverrides = super: {
|
||||
python = super.python.override {
|
||||
python3 = super.python3.override {
|
||||
packageOverrides = python-self: python-super: {
|
||||
twisted = python-super.twisted.overrideAttrs (oldAttrs: {
|
||||
twisted = python-super.twisted.overridePythonAttrs (oldAttrs: {
|
||||
src = super.fetchPypi {
|
||||
pname = "twisted";
|
||||
version = "19.10.0";
|
||||
|
||||
@@ -319,6 +319,18 @@ The above are just guidelines, and exceptions may be granted on a case-by-case b
|
||||
However, please check if it's possible to disable a problematic subset of the
|
||||
test suite and leave a comment explaining your reasoning.
|
||||
|
||||
This can be achived with `--skip` in `checkFlags`:
|
||||
|
||||
```nix
|
||||
rustPlatform.buildRustPackage {
|
||||
/* ... */
|
||||
checkFlags = [
|
||||
# reason for disabling test
|
||||
"--skip=example::tests:example_test"
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
#### Setting `test-threads` {#setting-test-threads}
|
||||
|
||||
`buildRustPackage` will use parallel test threads by default,
|
||||
|
||||
@@ -170,8 +170,8 @@ of precompiled grammars, you can use `nvim-treesitter.withPlugins` function:
|
||||
start = [
|
||||
(nvim-treesitter.withPlugins (
|
||||
plugins: with plugins; [
|
||||
tree-sitter-nix
|
||||
tree-sitter-python
|
||||
nix
|
||||
python
|
||||
]
|
||||
))
|
||||
];
|
||||
@@ -180,7 +180,7 @@ of precompiled grammars, you can use `nvim-treesitter.withPlugins` function:
|
||||
})
|
||||
```
|
||||
|
||||
To enable all grammars packaged in nixpkgs, use `(pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars))`.
|
||||
To enable all grammars packaged in nixpkgs, use `pkgs.vimPlugins.nvim-treesitter.withAllGrammars`.
|
||||
|
||||
## Managing plugins with vim-plug {#managing-plugins-with-vim-plug}
|
||||
|
||||
@@ -203,6 +203,8 @@ Note: this is not possible anymore for Neovim.
|
||||
|
||||
Nix expressions for Vim plugins are stored in [pkgs/applications/editors/vim/plugins](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/vim/plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`./update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py). This creates a [generated.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/vim-plugin-names). Plugins are listed in alphabetical order in `vim-plugin-names` using the format `[github username]/[repository]@[gitref]`. For example https://github.com/scrooloose/nerdtree becomes `scrooloose/nerdtree`.
|
||||
|
||||
After running `./update.py`, if nvim-treesitter received an update, also run [`nvim-treesitter/update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py) to update the tree sitter grammars for `nvim-treesitter`.
|
||||
|
||||
Some plugins require overrides in order to function properly. Overrides are placed in [overrides.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/overrides.nix). Overrides are most often required when a plugin requires some dependencies, or extra steps are required during the build process. For example `deoplete-fish` requires both `deoplete-nvim` and `vim-fish`, and so the following override was added:
|
||||
|
||||
```nix
|
||||
|
||||
@@ -44,8 +44,8 @@ $ nix-env -qa hello --json
|
||||
"mips32-linux",
|
||||
"x86_64-darwin",
|
||||
"i686-cygwin",
|
||||
"i686-freebsd",
|
||||
"x86_64-freebsd",
|
||||
"i686-freebsd13",
|
||||
"x86_64-freebsd13",
|
||||
"i686-openbsd",
|
||||
"x86_64-openbsd"
|
||||
],
|
||||
|
||||
+15
-159
@@ -887,7 +887,7 @@ Packages may expect or require other utilities to be available at runtime.
|
||||
|
||||
Use `--prefix` to explicitly set dependencies in `PATH`.
|
||||
|
||||
:::{note}
|
||||
::: {.note}
|
||||
`--prefix` essentially hard-codes dependencies into the wrapper.
|
||||
They cannot be overridden without rebuilding the package.
|
||||
:::
|
||||
@@ -1109,13 +1109,15 @@ This setup hook moves any libraries installed in the `lib64/` subdirectory into
|
||||
|
||||
This setup hook moves any systemd user units installed in the `lib/` subdirectory into `share/`. In addition, a link is provided from `share/` to `lib/` for compatibility. This is needed for systemd to find user services when installed into the user profile.
|
||||
|
||||
This hook only runs when compiling for Linux.
|
||||
|
||||
### `set-source-date-epoch-to-latest.sh` {#set-source-date-epoch-to-latest.sh}
|
||||
|
||||
This sets `SOURCE_DATE_EPOCH` to the modification time of the most recent file.
|
||||
|
||||
### Bintools Wrapper {#bintools-wrapper}
|
||||
### Bintools Wrapper and hook {#bintools-wrapper}
|
||||
|
||||
The Bintools Wrapper wraps the binary utilities for a bunch of miscellaneous purposes. These are GNU Binutils when targetting Linux, and a mix of cctools and GNU binutils for Darwin. \[The “Bintools” name is supposed to be a compromise between “Binutils” and “cctools” not denoting any specific implementation.\] Specifically, the underlying bintools package, and a C standard library (glibc or Darwin’s libSystem, just for the dynamic loader) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by the Bintools Wrapper. Packages typically depend on CC Wrapper, which in turn (at run time) depends on the Bintools Wrapper.
|
||||
The Bintools Wrapper wraps the binary utilities for a bunch of miscellaneous purposes. These are GNU Binutils when targeting Linux, and a mix of cctools and GNU binutils for Darwin. \[The “Bintools” name is supposed to be a compromise between “Binutils” and “cctools” not denoting any specific implementation.\] Specifically, the underlying bintools package, and a C standard library (glibc or Darwin’s libSystem, just for the dynamic loader) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by the Bintools Wrapper. Packages typically depend on CC Wrapper, which in turn (at run time) depends on the Bintools Wrapper.
|
||||
|
||||
The Bintools Wrapper was only just recently split off from CC Wrapper, so the division of labor is still being worked out. For example, it shouldn’t care about the C standard library, but just take a derivation with the dynamic loader (which happens to be the glibc on linux). Dependency finding however is a task both wrappers will continue to need to share, and probably the most important to understand. It is currently accomplished by collecting directories of host-platform dependencies (i.e. `buildInputs` and `nativeBuildInputs`) in environment variables. The Bintools Wrapper’s setup hook causes any `lib` and `lib64` subdirectories to be added to `NIX_LDFLAGS`. Since the CC Wrapper and the Bintools Wrapper use the same strategy, most of the Bintools Wrapper code is sparsely commented and refers to the CC Wrapper. But the CC Wrapper’s code, by contrast, has quite lengthy comments. The Bintools Wrapper merely cites those, rather than repeating them, to avoid falling out of sync.
|
||||
|
||||
@@ -1123,173 +1125,27 @@ A final task of the setup hook is defining a number of standard environment vari
|
||||
|
||||
A problem with this final task is that the Bintools Wrapper is honest and defines `LD` as `ld`. Most packages, however, firstly use the C compiler for linking, secondly use `LD` anyways, defining it as the C compiler, and thirdly, only so define `LD` when it is undefined as a fallback. This triple-threat means Bintools Wrapper will break those packages, as LD is already defined as the actual linker which the package won’t override yet doesn’t want to use. The workaround is to define, just for the problematic package, `LD` as the C compiler. A good way to do this would be `preConfigure = "LD=$CC"`.
|
||||
|
||||
### CC Wrapper {#cc-wrapper}
|
||||
### CC Wrapper and hook {#cc-wrapper}
|
||||
|
||||
The CC Wrapper wraps a C toolchain for a bunch of miscellaneous purposes. Specifically, a C compiler (GCC or Clang), wrapped binary tools, and a C standard library (glibc or Darwin’s libSystem, just for the dynamic loader) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by the CC Wrapper. Packages typically depend on the CC Wrapper, which in turn (at run-time) depends on the Bintools Wrapper.
|
||||
|
||||
Dependency finding is undoubtedly the main task of the CC Wrapper. This works just like the Bintools Wrapper, except that any `include` subdirectory of any relevant dependency is added to `NIX_CFLAGS_COMPILE`. The setup hook itself contains some lengthy comments describing the exact convoluted mechanism by which this is accomplished.
|
||||
Dependency finding is undoubtedly the main task of the CC Wrapper. This works just like the Bintools Wrapper, except that any `include` subdirectory of any relevant dependency is added to `NIX_CFLAGS_COMPILE`. The setup hook itself contains elaborate comments describing the exact mechanism by which this is accomplished.
|
||||
|
||||
Similarly, the CC Wrapper follows the Bintools Wrapper in defining standard environment variables with the names of the tools it wraps, for the same reasons described above. Importantly, while it includes a `cc` symlink to the c compiler for portability, the `CC` will be defined using the compiler’s “real name” (i.e. `gcc` or `clang`). This helps lousy build systems that inspect on the name of the compiler rather than run it.
|
||||
|
||||
Here are some more packages that provide a setup hook. Since the list of hooks is extensible, this is not an exhaustive list. The mechanism is only to be used as a last resort, so it might cover most uses.
|
||||
|
||||
### Perl {#setup-hook-perl}
|
||||
### Other hooks
|
||||
|
||||
Adds the `lib/site_perl` subdirectory of each build input to the `PERL5LIB` environment variable. For instance, if `buildInputs` contains Perl, then the `lib/site_perl` subdirectory of each input is added to the `PERL5LIB` environment variable.
|
||||
Many other packages provide hooks, that are not part of `stdenv`. You can find
|
||||
these in the [Hooks Reference](#chap-hooks).
|
||||
|
||||
### Python {#setup-hook-python}
|
||||
### Compiler and Linker wrapper hooks {#compiler-linker-wrapper-hooks}
|
||||
|
||||
Adds the `lib/${python.libPrefix}/site-packages` subdirectory of each build input to the `PYTHONPATH` environment variable.
|
||||
|
||||
### pkg-config {#setup-hook-pkg-config}
|
||||
|
||||
Adds the `lib/pkgconfig` and `share/pkgconfig` subdirectories of each build input to the `PKG_CONFIG_PATH` environment variable.
|
||||
|
||||
### Automake {#setup-hook-automake}
|
||||
|
||||
Adds the `share/aclocal` subdirectory of each build input to the `ACLOCAL_PATH` environment variable.
|
||||
|
||||
### Autoconf {#setup-hook-autoconf}
|
||||
|
||||
The `autoreconfHook` derivation adds `autoreconfPhase`, which runs autoreconf, libtoolize and automake, essentially preparing the configure script in autotools-based builds. Most autotools-based packages come with the configure script pre-generated, but this hook is necessary for a few packages and when you need to patch the package’s configure scripts.
|
||||
|
||||
### libxml2 {#setup-hook-libxml2}
|
||||
|
||||
Adds every file named `catalog.xml` found under the `xml/dtd` and `xml/xsl` subdirectories of each build input to the `XML_CATALOG_FILES` environment variable.
|
||||
|
||||
### teTeX / TeX Live {#tetex-tex-live}
|
||||
|
||||
Adds the `share/texmf-nix` subdirectory of each build input to the `TEXINPUTS` environment variable.
|
||||
|
||||
### Qt 4 {#qt-4}
|
||||
|
||||
Sets the `QTDIR` environment variable to Qt’s path.
|
||||
|
||||
### gdk-pixbuf {#setup-hook-gdk-pixbuf}
|
||||
|
||||
Exports `GDK_PIXBUF_MODULE_FILE` environment variable to the builder. Add librsvg package to `buildInputs` to get svg support. See also the [setup hook description in GNOME platform docs](#ssec-gnome-hooks-gdk-pixbuf).
|
||||
|
||||
### GHC {#ghc}
|
||||
|
||||
Creates a temporary package database and registers every Haskell build input in it (TODO: how?).
|
||||
|
||||
### GNOME platform {#gnome-platform}
|
||||
|
||||
Hooks related to GNOME platform and related libraries like GLib, GTK and GStreamer are described in [](#sec-language-gnome).
|
||||
|
||||
### autoPatchelfHook {#setup-hook-autopatchelfhook}
|
||||
|
||||
This is a special setup hook which helps in packaging proprietary software in that it automatically tries to find missing shared library dependencies of ELF files based on the given `buildInputs` and `nativeBuildInputs`.
|
||||
|
||||
You can also specify a `runtimeDependencies` variable which lists dependencies to be unconditionally added to rpath of all executables. This is useful for programs that use dlopen 3 to load libraries at runtime.
|
||||
|
||||
In certain situations you may want to run the main command (`autoPatchelf`) of the setup hook on a file or a set of directories instead of unconditionally patching all outputs. This can be done by setting the `dontAutoPatchelf` environment variable to a non-empty value.
|
||||
|
||||
By default `autoPatchelf` will fail as soon as any ELF file requires a dependency which cannot be resolved via the given build inputs. In some situations you might prefer to just leave missing dependencies unpatched and continue to patch the rest. This can be achieved by setting the `autoPatchelfIgnoreMissingDeps` environment variable to a non-empty value. `autoPatchelfIgnoreMissingDeps` can be set to a list like `autoPatchelfIgnoreMissingDeps = [ "libcuda.so.1" "libcudart.so.1" ];` or to simply `[ "*" ]` to ignore all missing dependencies.
|
||||
|
||||
The `autoPatchelf` command also recognizes a `--no-recurse` command line flag, which prevents it from recursing into subdirectories.
|
||||
|
||||
### breakpointHook {#breakpointhook}
|
||||
|
||||
This hook will make a build pause instead of stopping when a failure happens. It prevents nix from cleaning up the build environment immediately and allows the user to attach to a build environment using the `cntr` command. Upon build error it will print instructions on how to use `cntr`, which can be used to enter the environment for debugging. Installing cntr and running the command will provide shell access to the build sandbox of failed build. At `/var/lib/cntr` the sandboxed filesystem is mounted. All commands and files of the system are still accessible within the shell. To execute commands from the sandbox use the cntr exec subcommand. `cntr` is only supported on Linux-based platforms. To use it first add `cntr` to your `environment.systemPackages` on NixOS or alternatively to the root user on non-NixOS systems. Then in the package that is supposed to be inspected, add `breakpointHook` to `nativeBuildInputs`.
|
||||
|
||||
```nix
|
||||
nativeBuildInputs = [ breakpointHook ];
|
||||
```
|
||||
|
||||
When a build failure happens there will be an instruction printed that shows how to attach with `cntr` to the build sandbox.
|
||||
|
||||
::: {.note}
|
||||
::: {.title}
|
||||
Caution with remote builds
|
||||
:::
|
||||
|
||||
This won’t work with remote builds as the build environment is on a different machine and can’t be accessed by `cntr`. Remote builds can be turned off by setting `--option builders ''` for `nix-build` or `--builders ''` for `nix build`.
|
||||
:::
|
||||
|
||||
### installShellFiles {#installshellfiles}
|
||||
|
||||
This hook helps with installing manpages and shell completion files. It exposes 2 shell functions `installManPage` and `installShellCompletion` that can be used from your `postInstall` hook.
|
||||
|
||||
The `installManPage` function takes one or more paths to manpages to install. The manpages must have a section suffix, and may optionally be compressed (with `.gz` suffix). This function will place them into the correct directory.
|
||||
|
||||
The `installShellCompletion` function takes one or more paths to shell completion files. By default it will autodetect the shell type from the completion file extension, but you may also specify it by passing one of `--bash`, `--fish`, or `--zsh`. These flags apply to all paths listed after them (up until another shell flag is given). Each path may also have a custom installation name provided by providing a flag `--name NAME` before the path. If this flag is not provided, zsh completions will be renamed automatically such that `foobar.zsh` becomes `_foobar`. A root name may be provided for all paths using the flag `--cmd NAME`; this synthesizes the appropriate name depending on the shell (e.g. `--cmd foo` will synthesize the name `foo.bash` for bash and `_foo` for zsh). The path may also be a fifo or named fd (such as produced by `<(cmd)`), in which case the shell and name must be provided.
|
||||
|
||||
```nix
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
postInstall = ''
|
||||
installManPage doc/foobar.1 doc/barfoo.3
|
||||
# explicit behavior
|
||||
installShellCompletion --bash --name foobar.bash share/completions.bash
|
||||
installShellCompletion --fish --name foobar.fish share/completions.fish
|
||||
installShellCompletion --zsh --name _foobar share/completions.zsh
|
||||
# implicit behavior
|
||||
installShellCompletion share/completions/foobar.{bash,fish,zsh}
|
||||
# using named fd
|
||||
installShellCompletion --cmd foobar \
|
||||
--bash <($out/bin/foobar --bash-completion) \
|
||||
--fish <($out/bin/foobar --fish-completion) \
|
||||
--zsh <($out/bin/foobar --zsh-completion)
|
||||
'';
|
||||
```
|
||||
|
||||
### libiconv, libintl {#libiconv-libintl}
|
||||
|
||||
A few libraries automatically add to `NIX_LDFLAGS` their library, making their symbols automatically available to the linker. This includes libiconv and libintl (gettext). This is done to provide compatibility between GNU Linux, where libiconv and libintl are bundled in, and other systems where that might not be the case. Sometimes, this behavior is not desired. To disable this behavior, set `dontAddExtraLibs`.
|
||||
|
||||
### validatePkgConfig {#validatepkgconfig}
|
||||
|
||||
The `validatePkgConfig` hook validates all pkg-config (`.pc`) files in a package. This helps catching some common errors in pkg-config files, such as undefined variables.
|
||||
|
||||
### cmake {#cmake}
|
||||
|
||||
Overrides the default configure phase to run the CMake command. By default, we use the Make generator of CMake. In addition, dependencies are added automatically to `CMAKE_PREFIX_PATH` so that packages are correctly detected by CMake. Some additional flags are passed in to give similar behavior to configure-based packages. You can disable this hook’s behavior by setting `configurePhase` to a custom value, or by setting `dontUseCmakeConfigure`. `cmakeFlags` controls flags passed only to CMake. By default, parallel building is enabled as CMake supports parallel building almost everywhere. When Ninja is also in use, CMake will detect that and use the ninja generator.
|
||||
|
||||
### xcbuildHook {#xcbuildhook}
|
||||
|
||||
Overrides the build and install phases to run the "xcbuild" command. This hook is needed when a project only comes with build files for the XCode build system. You can disable this behavior by setting buildPhase and configurePhase to a custom value. xcbuildFlags controls flags passed only to xcbuild.
|
||||
|
||||
### Meson {#meson}
|
||||
|
||||
Overrides the configure phase to run meson to generate Ninja files. To run these files, you should accompany Meson with ninja. By default, `enableParallelBuilding` is enabled as Meson supports parallel building almost everywhere.
|
||||
|
||||
#### Variables controlling Meson {#variables-controlling-meson}
|
||||
|
||||
##### `mesonFlags` {#mesonflags}
|
||||
|
||||
Controls the flags passed to meson.
|
||||
|
||||
##### `mesonBuildType` {#mesonbuildtype}
|
||||
|
||||
Which [`--buildtype`](https://mesonbuild.com/Builtin-options.html#core-options) to pass to Meson. We default to `plain`.
|
||||
|
||||
##### `mesonAutoFeatures` {#mesonautofeatures}
|
||||
|
||||
What value to set [`-Dauto_features=`](https://mesonbuild.com/Builtin-options.html#core-options) to. We default to `enabled`.
|
||||
|
||||
##### `mesonWrapMode` {#mesonwrapmode}
|
||||
|
||||
What value to set [`-Dwrap_mode=`](https://mesonbuild.com/Builtin-options.html#core-options) to. We default to `nodownload` as we disallow network access.
|
||||
|
||||
##### `dontUseMesonConfigure` {#dontusemesonconfigure}
|
||||
|
||||
Disables using Meson’s `configurePhase`.
|
||||
|
||||
### ninja {#ninja}
|
||||
|
||||
Overrides the build, install, and check phase to run ninja instead of make. You can disable this behavior with the `dontUseNinjaBuild`, `dontUseNinjaInstall`, and `dontUseNinjaCheck`, respectively. Parallel building is enabled by default in Ninja.
|
||||
|
||||
### unzip {#unzip}
|
||||
|
||||
This setup hook will allow you to unzip .zip files specified in `$src`. There are many similar packages like `unrar`, `undmg`, etc.
|
||||
|
||||
### wafHook {#wafhook}
|
||||
|
||||
Overrides the configure, build, and install phases. This will run the “waf” script used by many projects. If `wafPath` (default `./waf`) doesn’t exist, it will copy the version of waf available in Nixpkgs. `wafFlags` can be used to pass flags to the waf script.
|
||||
|
||||
### scons {#scons}
|
||||
|
||||
Overrides the build, install, and check phases. This uses the scons build system as a replacement for make. scons does not provide a configure phase, so everything is managed at build and install time.
|
||||
If the file `${cc}/nix-support/cc-wrapper-hook` exists, it will be run at the end of the [compiler wrapper](#cc-wrapper).
|
||||
If the file `${binutils}/nix-support/post-link-hook` exists, it will be run at the end of the linker wrapper.
|
||||
These hooks allow a user to inject code into the wrappers.
|
||||
As an example, these hooks can be used to extract `extraBefore`, `params` and `extraAfter` which store all the command line arguments passed to the compiler and linker respectively.
|
||||
|
||||
## Purity in Nixpkgs {#sec-purity-in-nixpkgs}
|
||||
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
|
||||
lib = import ./lib;
|
||||
|
||||
forAllSystems = f: lib.genAttrs lib.systems.flakeExposed (system: f system);
|
||||
|
||||
forAllSystems = lib.genAttrs lib.systems.flakeExposed;
|
||||
in
|
||||
{
|
||||
lib = lib.extend (final: prev: {
|
||||
@@ -45,10 +44,19 @@
|
||||
}).nixos.manual.x86_64-linux;
|
||||
};
|
||||
|
||||
# The "legacy" in `legacyPackages` doesn't imply that the packages exposed
|
||||
# through this attribute are "legacy" packages. Instead, `legacyPackages`
|
||||
# is used here as a substitute attribute name for `packages`. The problem
|
||||
# with `packages` is that it makes operations like `nix flake show
|
||||
# nixpkgs` unusably slow due to the sheer number of packages the Nix CLI
|
||||
# needs to evaluate. But when the Nix CLI sees a `legacyPackages`
|
||||
# attribute it displays `omitted` instead of evaluating all packages,
|
||||
# which keeps `nix flake show` on Nixpkgs reasonably fast, though less
|
||||
# information rich.
|
||||
legacyPackages = forAllSystems (system: import ./. { inherit system; });
|
||||
|
||||
nixosModules = {
|
||||
notDetected = import ./nixos/modules/installer/scan/not-detected.nix;
|
||||
notDetected = ./nixos/modules/installer/scan/not-detected.nix;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
{ " " = 32;
|
||||
"!" = 33;
|
||||
"\"" = 34;
|
||||
"#" = 35;
|
||||
"$" = 36;
|
||||
"%" = 37;
|
||||
"&" = 38;
|
||||
"'" = 39;
|
||||
"(" = 40;
|
||||
")" = 41;
|
||||
"*" = 42;
|
||||
"+" = 43;
|
||||
"," = 44;
|
||||
"-" = 45;
|
||||
"." = 46;
|
||||
"/" = 47;
|
||||
"0" = 48;
|
||||
"1" = 49;
|
||||
"2" = 50;
|
||||
"3" = 51;
|
||||
"4" = 52;
|
||||
"5" = 53;
|
||||
"6" = 54;
|
||||
"7" = 55;
|
||||
"8" = 56;
|
||||
"9" = 57;
|
||||
":" = 58;
|
||||
";" = 59;
|
||||
"<" = 60;
|
||||
"=" = 61;
|
||||
">" = 62;
|
||||
"?" = 63;
|
||||
"@" = 64;
|
||||
"A" = 65;
|
||||
"B" = 66;
|
||||
"C" = 67;
|
||||
"D" = 68;
|
||||
"E" = 69;
|
||||
"F" = 70;
|
||||
"G" = 71;
|
||||
"H" = 72;
|
||||
"I" = 73;
|
||||
"J" = 74;
|
||||
"K" = 75;
|
||||
"L" = 76;
|
||||
"M" = 77;
|
||||
"N" = 78;
|
||||
"O" = 79;
|
||||
"P" = 80;
|
||||
"Q" = 81;
|
||||
"R" = 82;
|
||||
"S" = 83;
|
||||
"T" = 84;
|
||||
"U" = 85;
|
||||
"V" = 86;
|
||||
"W" = 87;
|
||||
"X" = 88;
|
||||
"Y" = 89;
|
||||
"Z" = 90;
|
||||
"[" = 91;
|
||||
"\\" = 92;
|
||||
"]" = 93;
|
||||
"^" = 94;
|
||||
"_" = 95;
|
||||
"`" = 96;
|
||||
"a" = 97;
|
||||
"b" = 98;
|
||||
"c" = 99;
|
||||
"d" = 100;
|
||||
"e" = 101;
|
||||
"f" = 102;
|
||||
"g" = 103;
|
||||
"h" = 104;
|
||||
"i" = 105;
|
||||
"j" = 106;
|
||||
"k" = 107;
|
||||
"l" = 108;
|
||||
"m" = 109;
|
||||
"n" = 110;
|
||||
"o" = 111;
|
||||
"p" = 112;
|
||||
"q" = 113;
|
||||
"r" = 114;
|
||||
"s" = 115;
|
||||
"t" = 116;
|
||||
"u" = 117;
|
||||
"v" = 118;
|
||||
"w" = 119;
|
||||
"x" = 120;
|
||||
"y" = 121;
|
||||
"z" = 122;
|
||||
"{" = 123;
|
||||
"|" = 124;
|
||||
"}" = 125;
|
||||
"~" = 126;
|
||||
}
|
||||
+1
-1
@@ -103,7 +103,7 @@ let
|
||||
getName getVersion
|
||||
nameFromURL enableFeature enableFeatureAs withFeature
|
||||
withFeatureAs fixedWidthString fixedWidthNumber isStorePath
|
||||
toInt readPathsFromFile fileContents;
|
||||
toInt toIntBase10 readPathsFromFile fileContents;
|
||||
inherit (self.stringsWithDeps) textClosureList textClosureMap
|
||||
noDepEntry fullDepEntry packEntry stringAfter;
|
||||
inherit (self.customisation) overrideDerivation makeOverridable
|
||||
|
||||
+40
-18
@@ -1,9 +1,23 @@
|
||||
# Functions for copying sources to the Nix store.
|
||||
{ lib }:
|
||||
{ # haskellPathsInDir : Path -> Map String Path
|
||||
# A map of all haskell packages defined in the given path,
|
||||
# identified by having a cabal file with the same name as the
|
||||
# directory itself.
|
||||
haskellPathsInDir = root:
|
||||
|
||||
let
|
||||
inherit (lib.strings)
|
||||
hasPrefix
|
||||
;
|
||||
in
|
||||
|
||||
{
|
||||
/*
|
||||
A map of all haskell packages defined in the given path,
|
||||
identified by having a cabal file with the same name as the
|
||||
directory itself.
|
||||
|
||||
Type: Path -> Map String Path
|
||||
*/
|
||||
haskellPathsInDir =
|
||||
# The directory within to search
|
||||
root:
|
||||
let # Files in the root
|
||||
root-files = builtins.attrNames (builtins.readDir root);
|
||||
# Files with their full paths
|
||||
@@ -17,15 +31,18 @@
|
||||
builtins.pathExists (value + "/${name}.cabal")
|
||||
) root-files-with-paths;
|
||||
in builtins.listToAttrs cabal-subdirs;
|
||||
# locateDominatingFile : RegExp
|
||||
# -> Path
|
||||
# -> Nullable { path : Path;
|
||||
# matches : [ MatchResults ];
|
||||
# }
|
||||
# Find the first directory containing a file matching 'pattern'
|
||||
# upward from a given 'file'.
|
||||
# Returns 'null' if no directories contain a file matching 'pattern'.
|
||||
locateDominatingFile = pattern: file:
|
||||
/*
|
||||
Find the first directory containing a file matching 'pattern'
|
||||
upward from a given 'file'.
|
||||
Returns 'null' if no directories contain a file matching 'pattern'.
|
||||
|
||||
Type: RegExp -> Path -> Nullable { path : Path; matches : [ MatchResults ]; }
|
||||
*/
|
||||
locateDominatingFile =
|
||||
# The pattern to search for
|
||||
pattern:
|
||||
# The file to start searching upward from
|
||||
file:
|
||||
let go = path:
|
||||
let files = builtins.attrNames (builtins.readDir path);
|
||||
matches = builtins.filter (match: match != null)
|
||||
@@ -44,10 +61,15 @@
|
||||
in go (if isDir then file else parent);
|
||||
|
||||
|
||||
# listFilesRecursive: Path -> [ Path ]
|
||||
#
|
||||
# Given a directory, return a flattened list of all files within it recursively.
|
||||
listFilesRecursive = dir: lib.flatten (lib.mapAttrsToList (name: type:
|
||||
/*
|
||||
Given a directory, return a flattened list of all files within it recursively.
|
||||
|
||||
Type: Path -> [ Path ]
|
||||
*/
|
||||
listFilesRecursive =
|
||||
# The path to recursively list
|
||||
dir:
|
||||
lib.flatten (lib.mapAttrsToList (name: type:
|
||||
if type == "directory" then
|
||||
lib.filesystem.listFilesRecursive (dir + "/${name}")
|
||||
else
|
||||
|
||||
+1
-1
@@ -378,7 +378,7 @@ rec {
|
||||
|
||||
attr = let attrFilter = name: value: name != "_module" && value != null;
|
||||
in ind: x: libStr.concatStringsSep "\n" (lib.flatten (lib.mapAttrsToList
|
||||
(name: value: lib.optional (attrFilter name value) [
|
||||
(name: value: lib.optionals (attrFilter name value) [
|
||||
(key "\t${ind}" name)
|
||||
(expr "\t${ind}" value)
|
||||
]) x));
|
||||
|
||||
+21
-20
@@ -78,6 +78,12 @@ in mkLicense lset) ({
|
||||
url = "https://aomedia.org/license/patent-license/";
|
||||
};
|
||||
|
||||
apsl10 = {
|
||||
spdxId = "APSL-1.0";
|
||||
fullName = "Apple Public Source License 1.0";
|
||||
url = "https://web.archive.org/web/20040701000000*/http://www.opensource.apple.com/apsl/1.0.txt";
|
||||
};
|
||||
|
||||
apsl20 = {
|
||||
spdxId = "APSL-2.0";
|
||||
fullName = "Apple Public Source License 2.0";
|
||||
@@ -103,6 +109,11 @@ in mkLicense lset) ({
|
||||
fullName = "Apache License 2.0";
|
||||
};
|
||||
|
||||
bitstreamVera = {
|
||||
spdxId = "Bitstream-Vera";
|
||||
fullName = "Bitstream Vera Font License";
|
||||
};
|
||||
|
||||
bola11 = {
|
||||
url = "https://blitiri.com.ar/p/bola/";
|
||||
fullName = "Buena Onda License Agreement 1.1";
|
||||
@@ -548,6 +559,16 @@ in mkLicense lset) ({
|
||||
free = false;
|
||||
};
|
||||
|
||||
lal12 = {
|
||||
spdxId = "LAL-1.2";
|
||||
fullName = "Licence Art Libre 1.2";
|
||||
};
|
||||
|
||||
lal13 = {
|
||||
spdxId = "LAL-1.3";
|
||||
fullName = "Licence Art Libre 1.3";
|
||||
};
|
||||
|
||||
lgpl2Only = {
|
||||
spdxId = "LGPL-2.0-only";
|
||||
fullName = "GNU Library General Public License v2 only";
|
||||
@@ -969,26 +990,6 @@ in mkLicense lset) ({
|
||||
fullName = "GNU Affero General Public License v3.0";
|
||||
deprecated = true;
|
||||
};
|
||||
fdl11 = {
|
||||
spdxId = "GFDL-1.1";
|
||||
fullName = "GNU Free Documentation License v1.1";
|
||||
deprecated = true;
|
||||
};
|
||||
fdl12 = {
|
||||
spdxId = "GFDL-1.2";
|
||||
fullName = "GNU Free Documentation License v1.2";
|
||||
deprecated = true;
|
||||
};
|
||||
fdl13 = {
|
||||
spdxId = "GFDL-1.3";
|
||||
fullName = "GNU Free Documentation License v1.3";
|
||||
deprecated = true;
|
||||
};
|
||||
gpl1 = {
|
||||
spdxId = "GPL-1.0";
|
||||
fullName = "GNU General Public License v1.0";
|
||||
deprecated = true;
|
||||
};
|
||||
gpl2 = {
|
||||
spdxId = "GPL-2.0";
|
||||
fullName = "GNU General Public License v2.0";
|
||||
|
||||
+2
-2
@@ -1135,10 +1135,10 @@ rec {
|
||||
type = toType;
|
||||
});
|
||||
config = mkMerge [
|
||||
{
|
||||
(optionalAttrs (options ? warnings) {
|
||||
warnings = optional (warn && fromOpt.isDefined)
|
||||
"The option `${showOption from}' defined in ${showFiles fromOpt.files} has been renamed to `${showOption to}'.";
|
||||
}
|
||||
})
|
||||
(if withPriority
|
||||
then mkAliasAndWrapDefsWithPriority (setAttrByPath to) fromOpt
|
||||
else mkAliasAndWrapDefinitions (setAttrByPath to) fromOpt)
|
||||
|
||||
+10
-4
@@ -123,7 +123,7 @@ rec {
|
||||
Example:
|
||||
mkPackageOption pkgs "GHC" {
|
||||
default = [ "ghc" ];
|
||||
example = "pkgs.haskell.packages.ghc924.ghc.withPackages (hkgs: [ hkgs.primes ])";
|
||||
example = "pkgs.haskell.packages.ghc92.ghc.withPackages (hkgs: [ hkgs.primes ])";
|
||||
}
|
||||
=> { _type = "option"; default = «derivation /nix/store/jxx55cxsjrf8kyh3fp2ya17q99w7541r-ghc-8.10.7.drv»; defaultText = { ... }; description = "The GHC package to use."; example = { ... }; type = { ... }; }
|
||||
*/
|
||||
@@ -322,10 +322,16 @@ rec {
|
||||
showOption = parts: let
|
||||
escapeOptionPart = part:
|
||||
let
|
||||
escaped = lib.strings.escapeNixString part;
|
||||
in if escaped == "\"${part}\""
|
||||
# We assume that these are "special values" and not real configuration data.
|
||||
# If it is real configuration data, it is rendered incorrectly.
|
||||
specialIdentifiers = [
|
||||
"<name>" # attrsOf (submodule {})
|
||||
"*" # listOf (submodule {})
|
||||
"<function body>" # functionTo
|
||||
];
|
||||
in if builtins.elem part specialIdentifiers
|
||||
then part
|
||||
else escaped;
|
||||
else lib.strings.escapeNixIdentifier part;
|
||||
in (concatStringsSep ".") (map escapeOptionPart parts);
|
||||
showFiles = files: concatStringsSep " and " (map (f: "`${f}'") files);
|
||||
|
||||
|
||||
+125
-6
@@ -185,6 +185,16 @@ rec {
|
||||
*/
|
||||
makeBinPath = makeSearchPathOutput "bin" "bin";
|
||||
|
||||
/* Normalize path, removing extranous /s
|
||||
|
||||
Type: normalizePath :: string -> string
|
||||
|
||||
Example:
|
||||
normalizePath "/a//b///c/"
|
||||
=> "/a/b/c/"
|
||||
*/
|
||||
normalizePath = s: (builtins.foldl' (x: y: if y == "/" && hasSuffix "/" x then x else x+y) "" (stringToCharacters s));
|
||||
|
||||
/* Depending on the boolean `cond', return either the given string
|
||||
or the empty string. Useful to concatenate against a bigger string.
|
||||
|
||||
@@ -294,6 +304,21 @@ rec {
|
||||
map f (stringToCharacters s)
|
||||
);
|
||||
|
||||
/* Convert char to ascii value, must be in printable range
|
||||
|
||||
Type: charToInt :: string -> int
|
||||
|
||||
Example:
|
||||
charToInt "A"
|
||||
=> 65
|
||||
charToInt "("
|
||||
=> 40
|
||||
|
||||
*/
|
||||
charToInt = let
|
||||
table = import ./ascii-table.nix;
|
||||
in c: builtins.getAttr c table;
|
||||
|
||||
/* Escape occurrence of the elements of `list` in `string` by
|
||||
prefixing it with a backslash.
|
||||
|
||||
@@ -305,6 +330,19 @@ rec {
|
||||
*/
|
||||
escape = list: replaceChars list (map (c: "\\${c}") list);
|
||||
|
||||
/* Escape occurence of the element of `list` in `string` by
|
||||
converting to its ASCII value and prefixing it with \\x.
|
||||
Only works for printable ascii characters.
|
||||
|
||||
Type: escapeC = [string] -> string -> string
|
||||
|
||||
Example:
|
||||
escapeC [" "] "foo bar"
|
||||
=> "foo\\x20bar"
|
||||
|
||||
*/
|
||||
escapeC = list: replaceChars list (map (c: "\\x${ toLower (lib.toHexString (charToInt c))}") list);
|
||||
|
||||
/* Quote string to be used safely within the Bourne shell.
|
||||
|
||||
Type: escapeShellArg :: string -> string
|
||||
@@ -745,24 +783,105 @@ rec {
|
||||
else
|
||||
false;
|
||||
|
||||
/* Parse a string as an int.
|
||||
/* Parse a string as an int. Does not support parsing of integers with preceding zero due to
|
||||
ambiguity between zero-padded and octal numbers. See toIntBase10.
|
||||
|
||||
Type: string -> int
|
||||
|
||||
Example:
|
||||
|
||||
toInt "1337"
|
||||
=> 1337
|
||||
|
||||
toInt "-4"
|
||||
=> -4
|
||||
|
||||
toInt " 123 "
|
||||
=> 123
|
||||
|
||||
toInt "00024"
|
||||
=> error: Ambiguity in interpretation of 00024 between octal and zero padded integer.
|
||||
|
||||
toInt "3.14"
|
||||
=> error: floating point JSON numbers are not supported
|
||||
*/
|
||||
# Obviously, it is a bit hacky to use fromJSON this way.
|
||||
toInt = str:
|
||||
let may_be_int = fromJSON str; in
|
||||
if isInt may_be_int
|
||||
then may_be_int
|
||||
else throw "Could not convert ${str} to int.";
|
||||
let
|
||||
# RegEx: Match any leading whitespace, then any digits, and finally match any trailing
|
||||
# whitespace.
|
||||
strippedInput = match "[[:space:]]*([[:digit:]]+)[[:space:]]*" str;
|
||||
|
||||
# RegEx: Match a leading '0' then one or more digits.
|
||||
isLeadingZero = match "0[[:digit:]]+" (head strippedInput) == [];
|
||||
|
||||
# Attempt to parse input
|
||||
parsedInput = fromJSON (head strippedInput);
|
||||
|
||||
generalError = "toInt: Could not convert ${escapeNixString str} to int.";
|
||||
|
||||
octalAmbigError = "toInt: Ambiguity in interpretation of ${escapeNixString str}"
|
||||
+ " between octal and zero padded integer.";
|
||||
|
||||
in
|
||||
# Error on presence of non digit characters.
|
||||
if strippedInput == null
|
||||
then throw generalError
|
||||
# Error on presence of leading zero/octal ambiguity.
|
||||
else if isLeadingZero
|
||||
then throw octalAmbigError
|
||||
# Error if parse function fails.
|
||||
else if !isInt parsedInput
|
||||
then throw generalError
|
||||
# Return result.
|
||||
else parsedInput;
|
||||
|
||||
|
||||
/* Parse a string as a base 10 int. This supports parsing of zero-padded integers.
|
||||
|
||||
Type: string -> int
|
||||
|
||||
Example:
|
||||
toIntBase10 "1337"
|
||||
=> 1337
|
||||
|
||||
toIntBase10 "-4"
|
||||
=> -4
|
||||
|
||||
toIntBase10 " 123 "
|
||||
=> 123
|
||||
|
||||
toIntBase10 "00024"
|
||||
=> 24
|
||||
|
||||
toIntBase10 "3.14"
|
||||
=> error: floating point JSON numbers are not supported
|
||||
*/
|
||||
toIntBase10 = str:
|
||||
let
|
||||
# RegEx: Match any leading whitespace, then match any zero padding, capture any remaining
|
||||
# digits after that, and finally match any trailing whitespace.
|
||||
strippedInput = match "[[:space:]]*0*([[:digit:]]+)[[:space:]]*" str;
|
||||
|
||||
# RegEx: Match at least one '0'.
|
||||
isZero = match "0+" (head strippedInput) == [];
|
||||
|
||||
# Attempt to parse input
|
||||
parsedInput = fromJSON (head strippedInput);
|
||||
|
||||
generalError = "toIntBase10: Could not convert ${escapeNixString str} to int.";
|
||||
|
||||
in
|
||||
# Error on presence of non digit characters.
|
||||
if strippedInput == null
|
||||
then throw generalError
|
||||
# In the special case zero-padded zero (00000), return early.
|
||||
else if isZero
|
||||
then 0
|
||||
# Error if parse function fails.
|
||||
else if !isInt parsedInput
|
||||
then throw generalError
|
||||
# Return result.
|
||||
else parsedInput;
|
||||
|
||||
/* Read a list of paths from `file`, relative to the `rootPath`.
|
||||
Lines beginning with `#` are treated as comments and ignored.
|
||||
|
||||
@@ -47,9 +47,10 @@ rec {
|
||||
else if final.isUClibc then "uclibc"
|
||||
else if final.isAndroid then "bionic"
|
||||
else if final.isLinux /* default */ then "glibc"
|
||||
else if final.isFreeBSD then "fblibc"
|
||||
else if final.isNetBSD then "nblibc"
|
||||
else if final.isAvr then "avrlibc"
|
||||
else if final.isNone then "newlib"
|
||||
else if final.isNetBSD then "nblibc"
|
||||
# TODO(@Ericson2314) think more about other operating systems
|
||||
else "native/impure";
|
||||
# Choose what linker we wish to use by default. Someday we might also
|
||||
@@ -183,14 +184,13 @@ rec {
|
||||
seccompSupport = false;
|
||||
hostCpuTargets = [ "${final.qemuArch}-linux-user" ];
|
||||
};
|
||||
wine-name = "wine${toString final.parsed.cpu.bits}";
|
||||
wine = (pkgs.winePackagesFor wine-name).minimal;
|
||||
wine = (pkgs.winePackagesFor "wine${toString final.parsed.cpu.bits}").minimal;
|
||||
in
|
||||
if final.parsed.kernel.name == pkgs.stdenv.hostPlatform.parsed.kernel.name &&
|
||||
pkgs.stdenv.hostPlatform.canExecute final
|
||||
then "${pkgs.runtimeShell} -c '\"$@\"' --"
|
||||
else if final.isWindows
|
||||
then "${wine}/bin/${wine-name}"
|
||||
then "${wine}/bin/wine${lib.optionalString (final.parsed.cpu.bits == 64) "64"}"
|
||||
else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux
|
||||
then "${qemu-user}/bin/qemu-${final.qemuArch}"
|
||||
else if final.isWasi
|
||||
|
||||
@@ -13,7 +13,7 @@ let
|
||||
"x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin"
|
||||
|
||||
# FreeBSD
|
||||
"i686-freebsd" "x86_64-freebsd"
|
||||
"i686-freebsd13" "x86_64-freebsd13"
|
||||
|
||||
# Genode
|
||||
"aarch64-genode" "i686-genode" "x86_64-genode"
|
||||
|
||||
@@ -303,15 +303,18 @@ rec {
|
||||
|
||||
# BSDs
|
||||
|
||||
x86_64-freebsd = {
|
||||
config = "x86_64-unknown-freebsd13";
|
||||
useLLVM = true;
|
||||
};
|
||||
|
||||
x86_64-netbsd = {
|
||||
config = "x86_64-unknown-netbsd";
|
||||
libc = "nblibc";
|
||||
};
|
||||
|
||||
# this is broken and never worked fully
|
||||
x86_64-netbsd-llvm = {
|
||||
config = "x86_64-unknown-netbsd";
|
||||
libc = "nblibc";
|
||||
useLLVM = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ rec {
|
||||
isiOS = { kernel = kernels.ios; };
|
||||
isLinux = { kernel = kernels.linux; };
|
||||
isSunOS = { kernel = kernels.solaris; };
|
||||
isFreeBSD = { kernel = kernels.freebsd; };
|
||||
isFreeBSD = { kernel = { name = "freebsd"; }; };
|
||||
isNetBSD = { kernel = kernels.netbsd; };
|
||||
isOpenBSD = { kernel = kernels.openbsd; };
|
||||
isWindows = { kernel = kernels.windows; };
|
||||
|
||||
+12
-3
@@ -290,7 +290,11 @@ rec {
|
||||
# the normalized name for macOS.
|
||||
macos = { execFormat = macho; families = { inherit darwin; }; name = "darwin"; };
|
||||
ios = { execFormat = macho; families = { inherit darwin; }; };
|
||||
freebsd = { execFormat = elf; families = { inherit bsd; }; };
|
||||
# A tricky thing about FreeBSD is that there is no stable ABI across
|
||||
# versions. That means that putting in the version as part of the
|
||||
# config string is paramount.
|
||||
freebsd12 = { execFormat = elf; families = { inherit bsd; }; name = "freebsd"; version = 12; };
|
||||
freebsd13 = { execFormat = elf; families = { inherit bsd; }; name = "freebsd"; version = 13; };
|
||||
linux = { execFormat = elf; families = { }; };
|
||||
netbsd = { execFormat = elf; families = { inherit bsd; }; };
|
||||
none = { execFormat = unknown; families = { }; };
|
||||
@@ -431,6 +435,8 @@ rec {
|
||||
then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "redox"; }
|
||||
else if (elemAt l 2 == "mmixware")
|
||||
then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = "mmixware"; }
|
||||
else if hasPrefix "freebsd" (elemAt l 2)
|
||||
then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; }
|
||||
else if hasPrefix "netbsd" (elemAt l 2)
|
||||
then { cpu = elemAt l 0; vendor = elemAt l 1; kernel = elemAt l 2; }
|
||||
else if (elem (elemAt l 2) ["eabi" "eabihf" "elf"])
|
||||
@@ -485,10 +491,13 @@ rec {
|
||||
|
||||
mkSystemFromString = s: mkSystemFromSkeleton (mkSkeletonFromList (lib.splitString "-" s));
|
||||
|
||||
kernelName = kernel:
|
||||
kernel.name + toString (kernel.version or "");
|
||||
|
||||
doubleFromSystem = { cpu, kernel, abi, ... }:
|
||||
/**/ if abi == abis.cygnus then "${cpu.name}-cygwin"
|
||||
else if kernel.families ? darwin then "${cpu.name}-darwin"
|
||||
else "${cpu.name}-${kernel.name}";
|
||||
else "${cpu.name}-${kernelName kernel}";
|
||||
|
||||
tripleFromSystem = { cpu, vendor, kernel, abi, ... } @ sys: assert isSystem sys; let
|
||||
optExecFormat =
|
||||
@@ -496,7 +505,7 @@ rec {
|
||||
gnuNetBSDDefaultExecFormat cpu != kernel.execFormat)
|
||||
kernel.execFormat.name;
|
||||
optAbi = lib.optionalString (abi != abis.unknown) "-${abi.name}";
|
||||
in "${cpu.name}-${vendor.name}-${kernel.name}${optExecFormat}${optAbi}";
|
||||
in "${cpu.name}-${vendor.name}-${kernelName kernel}${optExecFormat}${optAbi}";
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
@@ -312,6 +312,92 @@ runTests {
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testNormalizePath = {
|
||||
expr = strings.normalizePath "//a/b//c////d/";
|
||||
expected = "/a/b/c/d/";
|
||||
};
|
||||
|
||||
testCharToInt = {
|
||||
expr = strings.charToInt "A";
|
||||
expected = 65;
|
||||
};
|
||||
|
||||
testEscapeC = {
|
||||
expr = strings.escapeC [ " " ] "Hello World";
|
||||
expected = "Hello\\x20World";
|
||||
};
|
||||
|
||||
testToInt = testAllTrue [
|
||||
# Naive
|
||||
(123 == toInt "123")
|
||||
(0 == toInt "0")
|
||||
# Whitespace Padding
|
||||
(123 == toInt " 123")
|
||||
(123 == toInt "123 ")
|
||||
(123 == toInt " 123 ")
|
||||
(123 == toInt " 123 ")
|
||||
(0 == toInt " 0")
|
||||
(0 == toInt "0 ")
|
||||
(0 == toInt " 0 ")
|
||||
];
|
||||
|
||||
testToIntFails = testAllTrue [
|
||||
( builtins.tryEval (toInt "") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt "123 123") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt "0 123") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt " 0d ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt " 1d ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt " d0 ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt "00") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt "01") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt "002") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt " 002 ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt " foo ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt " foo 123 ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toInt " foo123 ") == { success = false; value = false; } )
|
||||
];
|
||||
|
||||
testToIntBase10 = testAllTrue [
|
||||
# Naive
|
||||
(123 == toIntBase10 "123")
|
||||
(0 == toIntBase10 "0")
|
||||
# Whitespace Padding
|
||||
(123 == toIntBase10 " 123")
|
||||
(123 == toIntBase10 "123 ")
|
||||
(123 == toIntBase10 " 123 ")
|
||||
(123 == toIntBase10 " 123 ")
|
||||
(0 == toIntBase10 " 0")
|
||||
(0 == toIntBase10 "0 ")
|
||||
(0 == toIntBase10 " 0 ")
|
||||
# Zero Padding
|
||||
(123 == toIntBase10 "0123")
|
||||
(123 == toIntBase10 "0000123")
|
||||
(0 == toIntBase10 "000000")
|
||||
# Whitespace and Zero Padding
|
||||
(123 == toIntBase10 " 0123")
|
||||
(123 == toIntBase10 "0123 ")
|
||||
(123 == toIntBase10 " 0123 ")
|
||||
(123 == toIntBase10 " 0000123")
|
||||
(123 == toIntBase10 "0000123 ")
|
||||
(123 == toIntBase10 " 0000123 ")
|
||||
(0 == toIntBase10 " 000000")
|
||||
(0 == toIntBase10 "000000 ")
|
||||
(0 == toIntBase10 " 000000 ")
|
||||
];
|
||||
|
||||
testToIntBase10Fails = testAllTrue [
|
||||
( builtins.tryEval (toIntBase10 "") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toIntBase10 "123 123") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toIntBase10 "0 123") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toIntBase10 " 0d ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toIntBase10 " 1d ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toIntBase10 " d0 ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toIntBase10 " foo ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toIntBase10 " foo 123 ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toIntBase10 " foo 00123 ") == { success = false; value = false; } )
|
||||
( builtins.tryEval (toIntBase10 " foo00123 ") == { success = false; value = false; } )
|
||||
];
|
||||
|
||||
# LISTS
|
||||
|
||||
testFilter = {
|
||||
|
||||
+10
-3
@@ -162,7 +162,7 @@ checkConfigError 'A definition for option .* is not.*string or signed integer co
|
||||
# Check coerced value with unsound coercion
|
||||
checkConfigOutput '^12$' config.value ./declare-coerced-value-unsound.nix
|
||||
checkConfigError 'A definition for option .* is not of type .*. Definition values:\n\s*- In .*: "1000"' config.value ./declare-coerced-value-unsound.nix ./define-value-string-bigint.nix
|
||||
checkConfigError 'json.exception.parse_error' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix
|
||||
checkConfigError 'toInt: Could not convert .* to int' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix
|
||||
|
||||
# Check mkAliasOptionModule.
|
||||
checkConfigOutput '^true$' config.enable ./alias-with-priority.nix
|
||||
@@ -302,11 +302,11 @@ checkConfigOutput '^"baz"$' config.value.nested.bar.baz ./types-anything/mk-mods
|
||||
## types.functionTo
|
||||
checkConfigOutput '^"input is input"$' config.result ./functionTo/trivial.nix
|
||||
checkConfigOutput '^"a b"$' config.result ./functionTo/merging-list.nix
|
||||
checkConfigError 'A definition for option .fun.\[function body\]. is not of type .string.. Definition values:\n\s*- In .*wrong-type.nix' config.result ./functionTo/wrong-type.nix
|
||||
checkConfigError 'A definition for option .fun.<function body>. is not of type .string.. Definition values:\n\s*- In .*wrong-type.nix' config.result ./functionTo/wrong-type.nix
|
||||
checkConfigOutput '^"b a"$' config.result ./functionTo/list-order.nix
|
||||
checkConfigOutput '^"a c"$' config.result ./functionTo/merging-attrs.nix
|
||||
checkConfigOutput '^"a bee"$' config.result ./functionTo/submodule-options.nix
|
||||
checkConfigOutput '^"fun.\[function body\].a fun.\[function body\].b"$' config.optionsResult ./functionTo/submodule-options.nix
|
||||
checkConfigOutput '^"fun.<function body>.a fun.<function body>.b"$' config.optionsResult ./functionTo/submodule-options.nix
|
||||
|
||||
# moduleType
|
||||
checkConfigOutput '^"a b"$' config.resultFoo ./declare-variants.nix ./define-variant.nix
|
||||
@@ -348,6 +348,13 @@ checkConfigOutput 'ok' config.freeformItems.foo.bar ./adhoc-freeformType-survive
|
||||
# because of an `extendModules` bug, issue 168767.
|
||||
checkConfigOutput '^1$' config.sub.specialisation.value ./extendModules-168767-imports.nix
|
||||
|
||||
# doRename works when `warnings` does not exist.
|
||||
checkConfigOutput '^1234$' config.c.d.e ./doRename-basic.nix
|
||||
# doRename adds a warning.
|
||||
checkConfigOutput '^"The option `a\.b. defined in `.*/doRename-warnings\.nix. has been renamed to `c\.d\.e.\."$' \
|
||||
config.result \
|
||||
./doRename-warnings.nix
|
||||
|
||||
cat <<EOF
|
||||
====== module tests ======
|
||||
$pass Pass
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{ lib, ... }: {
|
||||
imports = [
|
||||
(lib.doRename { from = ["a" "b"]; to = ["c" "d" "e"]; warn = true; use = x: x; visible = true; })
|
||||
];
|
||||
options = {
|
||||
c.d.e = lib.mkOption {};
|
||||
};
|
||||
config = {
|
||||
a.b = 1234;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{ lib, config, ... }: {
|
||||
imports = [
|
||||
(lib.doRename { from = ["a" "b"]; to = ["c" "d" "e"]; warn = true; use = x: x; visible = true; })
|
||||
];
|
||||
options = {
|
||||
warnings = lib.mkOption { type = lib.types.listOf lib.types.str; };
|
||||
c.d.e = lib.mkOption {};
|
||||
result = lib.mkOption {};
|
||||
};
|
||||
config = {
|
||||
a.b = 1234;
|
||||
result = lib.concatStringsSep "%" config.warnings;
|
||||
};
|
||||
}
|
||||
@@ -16,17 +16,17 @@ with lib.systems.doubles; lib.runTests {
|
||||
testall = mseteq all (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ wasi ++ windows ++ embedded ++ mmix ++ js ++ genode ++ redox);
|
||||
|
||||
testarm = mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv6l-netbsd" "armv6l-none" "armv7a-linux" "armv7a-netbsd" "armv7l-linux" "armv7l-netbsd" "arm-none" "armv7a-darwin" ];
|
||||
testi686 = mseteq i686 [ "i686-linux" "i686-freebsd" "i686-genode" "i686-netbsd" "i686-openbsd" "i686-cygwin" "i686-windows" "i686-none" "i686-darwin" ];
|
||||
testi686 = mseteq i686 [ "i686-linux" "i686-freebsd13" "i686-genode" "i686-netbsd" "i686-openbsd" "i686-cygwin" "i686-windows" "i686-none" "i686-darwin" ];
|
||||
testmips = mseteq mips [ "mips64el-linux" "mipsel-linux" "mipsel-netbsd" ];
|
||||
testmmix = mseteq mmix [ "mmix-mmixware" ];
|
||||
testriscv = mseteq riscv [ "riscv32-linux" "riscv64-linux" "riscv32-netbsd" "riscv64-netbsd" "riscv32-none" "riscv64-none" ];
|
||||
testriscv32 = mseteq riscv32 [ "riscv32-linux" "riscv32-netbsd" "riscv32-none" ];
|
||||
testriscv64 = mseteq riscv64 [ "riscv64-linux" "riscv64-netbsd" "riscv64-none" ];
|
||||
testx86_64 = mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-genode" "x86_64-redox" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" "x86_64-windows" "x86_64-none" ];
|
||||
testx86_64 = mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd13" "x86_64-genode" "x86_64-redox" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" "x86_64-windows" "x86_64-none" ];
|
||||
|
||||
testcygwin = mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ];
|
||||
testdarwin = mseteq darwin [ "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" ];
|
||||
testfreebsd = mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ];
|
||||
testfreebsd = mseteq freebsd [ "i686-freebsd13" "x86_64-freebsd13" ];
|
||||
testgenode = mseteq genode [ "aarch64-genode" "i686-genode" "x86_64-genode" ];
|
||||
testredox = mseteq redox [ "x86_64-redox" ];
|
||||
testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */);
|
||||
|
||||
@@ -514,6 +514,8 @@ rec {
|
||||
in
|
||||
[r] ++ go q;
|
||||
in
|
||||
assert (isInt base);
|
||||
assert (isInt i);
|
||||
assert (base >= 2);
|
||||
assert (i >= 0);
|
||||
lib.reverseList (go i);
|
||||
|
||||
+5
-3
@@ -262,7 +262,8 @@ rec {
|
||||
};
|
||||
|
||||
unspecified = mkOptionType {
|
||||
name = "unspecified value";
|
||||
name = "unspecified";
|
||||
description = "unspecified value";
|
||||
descriptionClass = "noun";
|
||||
};
|
||||
|
||||
@@ -477,6 +478,7 @@ rec {
|
||||
|
||||
path = mkOptionType {
|
||||
name = "path";
|
||||
descriptionClass = "noun";
|
||||
check = x: isCoercibleToString x && builtins.substring 0 1 (toString x) == "/";
|
||||
merge = mergeEqualOption;
|
||||
};
|
||||
@@ -616,8 +618,8 @@ rec {
|
||||
descriptionClass = "composite";
|
||||
check = isFunction;
|
||||
merge = loc: defs:
|
||||
fnArgs: (mergeDefinitions (loc ++ [ "[function body]" ]) elemType (map (fn: { inherit (fn) file; value = fn.value fnArgs; }) defs)).mergedValue;
|
||||
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "[function body]" ]);
|
||||
fnArgs: (mergeDefinitions (loc ++ [ "<function body>" ]) elemType (map (fn: { inherit (fn) file; value = fn.value fnArgs; }) defs)).mergedValue;
|
||||
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "<function body>" ]);
|
||||
getSubModules = elemType.getSubModules;
|
||||
substSubModules = m: functionTo (elemType.substSubModules m);
|
||||
functor = (defaultFunctor "functionTo") // { wrapped = elemType; };
|
||||
|
||||
+320
-28
@@ -69,6 +69,12 @@
|
||||
fingerprint = "F466 A548 AD3F C1F1 8C88 4576 8702 7528 B006 D66D";
|
||||
}];
|
||||
};
|
||||
_0xB10C = {
|
||||
email = "nixpkgs@b10c.me";
|
||||
name = "0xB10C";
|
||||
github = "0xb10c";
|
||||
githubId = 19157360;
|
||||
};
|
||||
_0xbe7a = {
|
||||
email = "nix@be7a.de";
|
||||
name = "Bela Stoyan";
|
||||
@@ -281,6 +287,13 @@
|
||||
githubId = 124545;
|
||||
name = "Anthony Cowley";
|
||||
};
|
||||
adamcstephens = {
|
||||
email = "happy.plan4249@valkor.net";
|
||||
matrix = "@adam:valkor.net";
|
||||
github = "adamcstephens";
|
||||
githubId = 2071575;
|
||||
name = "Adam C. Stephens";
|
||||
};
|
||||
adamlwgriffiths = {
|
||||
email = "adam.lw.griffiths@gmail.com";
|
||||
github = "adamlwgriffiths";
|
||||
@@ -326,10 +339,10 @@
|
||||
name = "Maxwell Huang-Hobbs";
|
||||
};
|
||||
adjacentresearch = {
|
||||
email = "nate@adjacentresearch.xyz";
|
||||
github = "0xperp";
|
||||
githubId = 96147421;
|
||||
name = "0xperp";
|
||||
email = "nate@adjacentresearch.xyz";
|
||||
github = "0xperp";
|
||||
githubId = 96147421;
|
||||
name = "0xperp";
|
||||
};
|
||||
adnelson = {
|
||||
email = "ithinkican@gmail.com";
|
||||
@@ -528,10 +541,10 @@
|
||||
name = "Aksh Gupta";
|
||||
};
|
||||
alapshin = {
|
||||
email = "alapshin@fastmail.com";
|
||||
github = "alapshin";
|
||||
githubId = 321946;
|
||||
name = "Andrei Lapshin";
|
||||
email = "alapshin@fastmail.com";
|
||||
github = "alapshin";
|
||||
githubId = 321946;
|
||||
name = "Andrei Lapshin";
|
||||
};
|
||||
albakham = {
|
||||
email = "dev@geber.ga";
|
||||
@@ -813,6 +826,7 @@
|
||||
};
|
||||
AndersonTorres = {
|
||||
email = "torres.anderson.85@protonmail.com";
|
||||
matrix = "@anderson_torres:matrix.org";
|
||||
github = "AndersonTorres";
|
||||
githubId = 5954806;
|
||||
name = "Anderson Torres";
|
||||
@@ -1241,6 +1255,15 @@
|
||||
githubId = 12923;
|
||||
name = "Astro";
|
||||
};
|
||||
astrobeastie = {
|
||||
email = "fischervincent98@gmail.com";
|
||||
github = "astrobeastie";
|
||||
githubId = 26362368;
|
||||
name = "Vincent Fischer";
|
||||
keys = [{
|
||||
fingerprint = "BF47 81E1 F304 1ADF 18CE C401 DE16 C7D1 536D A72F";
|
||||
}];
|
||||
};
|
||||
astsmtl = {
|
||||
email = "astsmtl@yandex.ru";
|
||||
github = "astsmtl";
|
||||
@@ -1472,6 +1495,12 @@
|
||||
githubId = 35324;
|
||||
name = "Badi' Abdul-Wahid";
|
||||
};
|
||||
baduhai = {
|
||||
email = "baduhai@pm.me";
|
||||
github = "baduhai";
|
||||
githubId = 31864305;
|
||||
name = "William";
|
||||
};
|
||||
baitinq = {
|
||||
email = "manuelpalenzuelamerino@gmail.com";
|
||||
name = "Baitinq";
|
||||
@@ -1541,6 +1570,12 @@
|
||||
githubId = 576355;
|
||||
name = "Bas van Dijk";
|
||||
};
|
||||
BattleCh1cken = {
|
||||
email = "BattleCh1cken@larkov.de";
|
||||
github = "BattleCh1cken";
|
||||
githubId = 75806385;
|
||||
name = "Felix Hass";
|
||||
};
|
||||
Baughn = {
|
||||
email = "sveina@gmail.com";
|
||||
github = "Baughn";
|
||||
@@ -1627,6 +1662,15 @@
|
||||
githubId = 214787;
|
||||
name = "Herwig Hochleitner";
|
||||
};
|
||||
benesim = {
|
||||
name = "Benjamin Isbarn";
|
||||
email = "benjamin.isbarn@gmail.com";
|
||||
github = "benesim";
|
||||
githubId = 29384538;
|
||||
keys = [{
|
||||
fingerprint = "D35E C9CE E631 638F F1D8 B401 6F0E 410D C3EE D02";
|
||||
}];
|
||||
};
|
||||
benley = {
|
||||
email = "benley@gmail.com";
|
||||
github = "benley";
|
||||
@@ -1745,6 +1789,12 @@
|
||||
githubId = 28444296;
|
||||
name = "Benjamin Hougland";
|
||||
};
|
||||
bigzilla = {
|
||||
email = "m.billyzaelani@gmail.com";
|
||||
github = "bigzilla";
|
||||
githubId = 20436235;
|
||||
name = "Billy Zaelani Malik";
|
||||
};
|
||||
billewanick = {
|
||||
email = "bill@ewanick.com";
|
||||
github = "billewanick";
|
||||
@@ -2113,6 +2163,13 @@
|
||||
githubId = 51231053;
|
||||
name = "Daniel";
|
||||
};
|
||||
calavera = {
|
||||
email = "david.calavera@gmail.com";
|
||||
github = "calavera";
|
||||
githubId = 1050;
|
||||
matrix = "@davidcalavera:matrix.org";
|
||||
name = "David Calavera";
|
||||
};
|
||||
callahad = {
|
||||
email = "dan.callahan@gmail.com";
|
||||
github = "callahad";
|
||||
@@ -2209,6 +2266,12 @@
|
||||
githubId = 5394722;
|
||||
name = "Spencer Baugh";
|
||||
};
|
||||
catouc = {
|
||||
email = "catouc@philipp.boeschen.me";
|
||||
github = "catouc";
|
||||
githubId = 25623213;
|
||||
name = "Philipp Böschen";
|
||||
};
|
||||
caugner = {
|
||||
email = "nixos@caugner.de";
|
||||
github = "caugner";
|
||||
@@ -2444,6 +2507,12 @@
|
||||
fingerprint = "4EBB 30F1 E89A 541A A7F2 52BE 830A 9728 6309 66F4";
|
||||
}];
|
||||
};
|
||||
christophcharles = {
|
||||
email = "23055925+christophcharles@users.noreply.github.com";
|
||||
github = "christophcharles";
|
||||
githubId = 23055925;
|
||||
name = "Christoph Charles";
|
||||
};
|
||||
christopherpoole = {
|
||||
email = "mail@christopherpoole.net";
|
||||
github = "christopherpoole";
|
||||
@@ -2570,6 +2639,12 @@
|
||||
githubId = 71959829;
|
||||
name = "Cleeyv";
|
||||
};
|
||||
clerie = {
|
||||
email = "nix@clerie.de";
|
||||
github = "clerie";
|
||||
githubId = 9381848;
|
||||
name = "clerie";
|
||||
};
|
||||
cleverca22 = {
|
||||
email = "cleverca22@gmail.com";
|
||||
matrix = "@cleverca22:matrix.org";
|
||||
@@ -2640,6 +2715,16 @@
|
||||
githubId = 5561189;
|
||||
name = "Cody Opel";
|
||||
};
|
||||
cofob = {
|
||||
name = "Egor Ternovoy";
|
||||
email = "cofob@riseup.net";
|
||||
matrix = "@cofob:matrix.org";
|
||||
github = "cofob";
|
||||
githubId = 49928332;
|
||||
keys = [{
|
||||
fingerprint = "5F3D 9D3D ECE0 8651 DE14 D29F ACAD 4265 E193 794D";
|
||||
}];
|
||||
};
|
||||
Cogitri = {
|
||||
email = "oss@cogitri.dev";
|
||||
github = "Cogitri";
|
||||
@@ -2701,6 +2786,12 @@
|
||||
githubId = 40290417;
|
||||
name = "Seb Blair";
|
||||
};
|
||||
considerate = {
|
||||
email = "viktor.kronvall@gmail.com";
|
||||
github = "considerate";
|
||||
githubId = 217918;
|
||||
name = "Viktor Kronvall";
|
||||
};
|
||||
copumpkin = {
|
||||
email = "pumpkingod@gmail.com";
|
||||
github = "copumpkin";
|
||||
@@ -3435,6 +3526,12 @@
|
||||
githubId = 8852888;
|
||||
name = "David Izquierdo";
|
||||
};
|
||||
djacu = {
|
||||
email = "daniel.n.baker@gmail.com";
|
||||
github = "djacu";
|
||||
githubId = 7043297;
|
||||
name = "Daniel Baker";
|
||||
};
|
||||
djanatyn = {
|
||||
email = "djanatyn@gmail.com";
|
||||
github = "djanatyn";
|
||||
@@ -3598,6 +3695,12 @@
|
||||
githubId = 10198051;
|
||||
name = "Drew Risinger";
|
||||
};
|
||||
dritter = {
|
||||
email = "dritter03@googlemail.com";
|
||||
github = "dritter";
|
||||
githubId = 1544760;
|
||||
name = "Dominik Ritter";
|
||||
};
|
||||
drperceptron = {
|
||||
email = "92106371+drperceptron@users.noreply.github.com";
|
||||
github = "drperceptron";
|
||||
@@ -4055,6 +4158,15 @@
|
||||
githubId = 147284;
|
||||
name = "Jason Felice";
|
||||
};
|
||||
ercao = {
|
||||
email = "vip@ercao.cn";
|
||||
github = "ercao";
|
||||
githubId = 51725284;
|
||||
name = "ercao";
|
||||
keys = [{
|
||||
fingerprint = "F3B0 36F7 B0CB 0964 3C12 D3C7 FFAB D125 7ECF 0889";
|
||||
}];
|
||||
};
|
||||
erdnaxe = {
|
||||
email = "erdnaxe@crans.org";
|
||||
github = "erdnaxe";
|
||||
@@ -4358,6 +4470,12 @@
|
||||
githubId = 1276854;
|
||||
name = "Florian Peter";
|
||||
};
|
||||
farnoy = {
|
||||
email = "jakub@okonski.org";
|
||||
github = "farnoy";
|
||||
githubId = 345808;
|
||||
name = "Jakub Okoński";
|
||||
};
|
||||
fbeffa = {
|
||||
email = "beffa@fbengineering.ch";
|
||||
github = "fedeinthemix";
|
||||
@@ -4389,12 +4507,25 @@
|
||||
name = "Fedx sudo";
|
||||
matrix = "fedx:matrix.org";
|
||||
};
|
||||
fee1-dead = {
|
||||
email = "ent3rm4n@gmail.com";
|
||||
github = "fee1-dead";
|
||||
githubId = 43851243;
|
||||
name = "Deadbeef";
|
||||
};
|
||||
fehnomenal = {
|
||||
email = "fehnomenal@fehn.systems";
|
||||
github = "fehnomenal";
|
||||
githubId = 9959940;
|
||||
name = "Andreas Fehn";
|
||||
};
|
||||
felipeqq2 = {
|
||||
name = "Felipe Silva";
|
||||
email = "felipeqq2@outlook.com";
|
||||
github = "felipeqq2";
|
||||
githubId = 71830138;
|
||||
keys = [{ fingerprint = "F5F0 2BCE 3580 BF2B 707A AA8C 2FD3 4A9E 2671 91B8"; }];
|
||||
};
|
||||
felixscheinost = {
|
||||
name = "Felix Scheinost";
|
||||
email = "felix.scheinost@posteo.de";
|
||||
@@ -4501,12 +4632,6 @@
|
||||
githubId = 66178592;
|
||||
name = "Pavel Zolotarevskiy";
|
||||
};
|
||||
flexw = {
|
||||
email = "felix.weilbach@t-online.de";
|
||||
github = "FlexW";
|
||||
githubId = 19961516;
|
||||
name = "Felix Weilbach";
|
||||
};
|
||||
fliegendewurst = {
|
||||
email = "arne.keller@posteo.de";
|
||||
github = "FliegendeWurst";
|
||||
@@ -5183,6 +5308,16 @@
|
||||
github = "gytis-ivaskevicius";
|
||||
githubId = 23264966;
|
||||
};
|
||||
h7x4 = {
|
||||
name = "h7x4";
|
||||
email = "h7x4@nani.wtf";
|
||||
matrix = "@h7x4:nani.wtf";
|
||||
github = "h7x4";
|
||||
githubId = 14929991;
|
||||
keys = [{
|
||||
fingerprint = "F7D3 7890 228A 9074 40E1 FD48 46B9 228E 814A 2AAC";
|
||||
}];
|
||||
};
|
||||
hagl = {
|
||||
email = "harald@glie.be";
|
||||
github = "hagl";
|
||||
@@ -5665,6 +5800,12 @@
|
||||
githubId = 3661115;
|
||||
name = "Ingo Blechschmidt";
|
||||
};
|
||||
icewind1991 = {
|
||||
name = "Robin Appelman";
|
||||
email = "robin@icewind.nl";
|
||||
github = "icewind1991";
|
||||
githubId = 1283854;
|
||||
};
|
||||
icy-thought = {
|
||||
name = "Icy-Thought";
|
||||
email = "gilganyx@pm.me";
|
||||
@@ -5721,7 +5862,7 @@
|
||||
githubId = 40234257;
|
||||
name = "ilkecan bozdogan";
|
||||
};
|
||||
not-my-segfault = {
|
||||
not-my-segfault = {
|
||||
email = "michal@tar.black";
|
||||
matrix = "@michal:tar.black";
|
||||
github = "not-my-segfault";
|
||||
@@ -5845,6 +5986,12 @@
|
||||
githubId = 54999;
|
||||
name = "Ariel Nunez";
|
||||
};
|
||||
iopq = {
|
||||
email = "iop_jr@yahoo.com";
|
||||
github = "iopq";
|
||||
githubId = 1817528;
|
||||
name = "Igor Polyakov";
|
||||
};
|
||||
irenes = {
|
||||
name = "Irene Knapp";
|
||||
email = "ireneista@gmail.com";
|
||||
@@ -5961,6 +6108,12 @@
|
||||
github = "j0hax";
|
||||
githubId = 3802620;
|
||||
};
|
||||
j0lol = {
|
||||
name = "Jo";
|
||||
email = "me@j0.lol";
|
||||
github = "j0lol";
|
||||
githubId = 24716467;
|
||||
};
|
||||
j4m3s = {
|
||||
name = "James Landrein";
|
||||
email = "github@j4m3s.eu";
|
||||
@@ -6188,6 +6341,12 @@
|
||||
githubId = 117874;
|
||||
name = "Jeroen de Haas";
|
||||
};
|
||||
jdelStrother = {
|
||||
email = "me@delstrother.com";
|
||||
github = "jdelStrother";
|
||||
githubId = 2377;
|
||||
name = "Jonathan del Strother";
|
||||
};
|
||||
jdreaver = {
|
||||
email = "johndreaver@gmail.com";
|
||||
github = "jdreaver";
|
||||
@@ -6382,6 +6541,15 @@
|
||||
githubId = 1204734;
|
||||
name = "Emil Karlson";
|
||||
};
|
||||
jlamur = {
|
||||
email = "contact@juleslamur.fr";
|
||||
github = "jlamur";
|
||||
githubId = 7054317;
|
||||
name = "Jules Lamur";
|
||||
keys = [{
|
||||
fingerprint = "B768 6CD7 451A 650D 9C54 4204 6710 CF0C 1CBD 7762";
|
||||
}];
|
||||
};
|
||||
jlesquembre = {
|
||||
email = "jl@lafuente.me";
|
||||
github = "jlesquembre";
|
||||
@@ -7321,6 +7489,18 @@
|
||||
githubId = 2037002;
|
||||
name = "Konstantinos";
|
||||
};
|
||||
kototama = {
|
||||
email = "kototama@posteo.jp";
|
||||
github = "kototama";
|
||||
githubId = 128620;
|
||||
name = "Kototama";
|
||||
};
|
||||
kouyk = {
|
||||
email = "skykinetic@stevenkou.xyz";
|
||||
github = "kouyk";
|
||||
githubId = 1729497;
|
||||
name = "Steven Kou";
|
||||
};
|
||||
kovirobi = {
|
||||
email = "kovirobi@gmail.com";
|
||||
github = "KoviRobi";
|
||||
@@ -7466,6 +7646,12 @@
|
||||
githubId = 72546287;
|
||||
name = "L3af";
|
||||
};
|
||||
laalsaas = {
|
||||
email = "laalsaas@systemli.org";
|
||||
github = "laalsaas";
|
||||
githubId = 43275254;
|
||||
name = "laalsaas";
|
||||
};
|
||||
lach = {
|
||||
email = "iam@lach.pw";
|
||||
github = "CertainLach";
|
||||
@@ -8478,6 +8664,12 @@
|
||||
githubId = 95194;
|
||||
name = "Mauricio Scheffer";
|
||||
};
|
||||
maxhero = {
|
||||
email = "contact@maxhero.dev";
|
||||
github = "themaxhero";
|
||||
githubId = 4708337;
|
||||
name = "Marcelo A. de L. Santos";
|
||||
};
|
||||
max-niederman = {
|
||||
email = "max@maxniederman.com";
|
||||
github = "max-niederman";
|
||||
@@ -8739,7 +8931,7 @@
|
||||
email = "megoettlinger@gmail.com";
|
||||
github = "mgttlinger";
|
||||
githubId = 5120487;
|
||||
name = "Merlin Göttlinger";
|
||||
name = "Merlin Humml";
|
||||
};
|
||||
mguentner = {
|
||||
email = "code@klandest.in";
|
||||
@@ -9020,6 +9212,15 @@
|
||||
fingerprint = "E90C BA34 55B3 6236 740C 038F 0D94 8CE1 9CF4 9C5F";
|
||||
}];
|
||||
};
|
||||
mktip = {
|
||||
email = "mo.issa.ok+nix@gmail.com";
|
||||
github = "mktip";
|
||||
githubId = 45905717;
|
||||
name = "Mohammad Issa";
|
||||
keys = [{
|
||||
fingerprint = "64BE BF11 96C3 DD7A 443E 8314 1DC0 82FA DE5B A863";
|
||||
}];
|
||||
};
|
||||
mlieberman85 = {
|
||||
email = "mlieberman85@gmail.com";
|
||||
github = "mlieberman85";
|
||||
@@ -9301,6 +9502,12 @@
|
||||
githubId = 11706080;
|
||||
name = "Moritz Clasmeier";
|
||||
};
|
||||
mtoohey = {
|
||||
name = "Matthew Toohey";
|
||||
email = "contact@mtoohey.com";
|
||||
github = "mtoohey31";
|
||||
githubId = 36740602;
|
||||
};
|
||||
MtP = {
|
||||
email = "marko.nixos@poikonen.de";
|
||||
github = "MtP76";
|
||||
@@ -9372,6 +9579,12 @@
|
||||
githubId = 772914;
|
||||
name = "Mikael Voss";
|
||||
};
|
||||
mwolfe = {
|
||||
email = "corp@m0rg.dev";
|
||||
github = "m0rg-dev";
|
||||
githubId = 38578268;
|
||||
name = "Morgan Wolfe";
|
||||
};
|
||||
maxwilson = {
|
||||
email = "nixpkgs@maxwilson.dev";
|
||||
github = "mwilsoncoding";
|
||||
@@ -10003,7 +10216,7 @@
|
||||
matrix = "@obfusk:matrix.org";
|
||||
github = "obfusk";
|
||||
githubId = 1260687;
|
||||
name = "Felix C. Stegerman";
|
||||
name = "FC Stegerman";
|
||||
keys = [{
|
||||
fingerprint = "D5E4 A51D F8D2 55B9 FAC6 A9BB 2F96 07F0 9B36 0F2D";
|
||||
}];
|
||||
@@ -10676,6 +10889,15 @@
|
||||
fingerprint = "B00F E582 FD3F 0732 EA48 3937 F558 14E4 D687 4375";
|
||||
}];
|
||||
};
|
||||
PlayerNameHere = {
|
||||
name = "Dixon Sean Low Yan Feng";
|
||||
email = "dixonseanlow@protonmail.com";
|
||||
github = "PlayerNameHere";
|
||||
githubId = 56017218;
|
||||
keys = [{
|
||||
fingerprint = "E6F4 BFB4 8DE3 893F 68FC A15F FF5F 4B30 A41B BAC8";
|
||||
}];
|
||||
};
|
||||
plchldr = {
|
||||
email = "mail@oddco.de";
|
||||
github = "plchldr";
|
||||
@@ -10688,6 +10910,12 @@
|
||||
githubId = 358550;
|
||||
name = "Philip Lykke Carlsen";
|
||||
};
|
||||
pleshevskiy = {
|
||||
email = "dmitriy@pleshevski.ru";
|
||||
github = "pleshevskiy";
|
||||
githubId = 7839004;
|
||||
name = "Dmitriy Pleshevskiy";
|
||||
};
|
||||
plumps = {
|
||||
email = "maks.bronsky@web.de";
|
||||
github = "plumps";
|
||||
@@ -11572,6 +11800,12 @@
|
||||
githubId = 12312980;
|
||||
name = "Robbin C.";
|
||||
};
|
||||
robbins = {
|
||||
email = "nejrobbins@gmail.com";
|
||||
github = "robbins";
|
||||
githubId = 31457698;
|
||||
name = "Nathanael Robbins";
|
||||
};
|
||||
roberth = {
|
||||
email = "nixpkgs@roberthensing.nl";
|
||||
matrix = "@roberthensing:matrix.org";
|
||||
@@ -11694,6 +11928,15 @@
|
||||
githubId = 373566;
|
||||
name = "Ronuk Raval";
|
||||
};
|
||||
rrbutani = {
|
||||
email = "rrbutani+nix@gmail.com";
|
||||
github = "rrbutani";
|
||||
githubId = 7833358;
|
||||
keys = [{
|
||||
fingerprint = "7DCA 5615 8AB2 621F 2F32 9FF4 1C7C E491 479F A273";
|
||||
}];
|
||||
name = "Rahul Butani";
|
||||
};
|
||||
rski = {
|
||||
name = "rski";
|
||||
email = "rom.skiad+nix@gmail.com";
|
||||
@@ -12083,6 +12326,16 @@
|
||||
githubId = 3598650;
|
||||
name = "Fritz Otlinghaus";
|
||||
};
|
||||
Scrumplex = {
|
||||
name = "Sefa Eyeoglu";
|
||||
email = "contact@scrumplex.net";
|
||||
matrix = "@Scrumplex:duckhub.io";
|
||||
github = "Scrumplex";
|
||||
githubId = 11587657;
|
||||
keys = [{
|
||||
fingerprint = "AF1F B107 E188 CB97 9A94 FD7F C104 1129 4912 A422";
|
||||
}];
|
||||
};
|
||||
scubed2 = {
|
||||
email = "scubed2@gmail.com";
|
||||
github = "scubed2";
|
||||
@@ -12126,6 +12379,15 @@
|
||||
githubId = 1940568;
|
||||
name = "Sebastian Ball";
|
||||
};
|
||||
seberm = {
|
||||
email = "seberm@seberm.com";
|
||||
github = "seberm";
|
||||
githubId = 212597;
|
||||
name = "Otto Sabart";
|
||||
keys = [{
|
||||
fingerprint = "0AF6 4C3B 1F12 14B3 8C8C 5786 1FA2 DBE6 7438 7CC3";
|
||||
}];
|
||||
};
|
||||
sebtm = {
|
||||
email = "mail@sebastian-sellmeier.de";
|
||||
github = "SebTM";
|
||||
@@ -13004,6 +13266,12 @@
|
||||
githubId = 19905904;
|
||||
name = "Simon Weber";
|
||||
};
|
||||
sweenu = {
|
||||
name = "sweenu";
|
||||
email = "contact@sweenu.xyz";
|
||||
github = "sweenu";
|
||||
githubId = 7051978;
|
||||
};
|
||||
swflint = {
|
||||
email = "swflint@flintfam.org";
|
||||
github = "swflint";
|
||||
@@ -13163,6 +13431,12 @@
|
||||
githubId = 102685;
|
||||
name = "Thomas Friese";
|
||||
};
|
||||
taylor1791 = {
|
||||
email = "nixpkgs@tayloreverding.com";
|
||||
github = "taylor1791";
|
||||
githubId = 555003;
|
||||
name = "Taylor Everding";
|
||||
};
|
||||
tazjin = {
|
||||
email = "mail@tazj.in";
|
||||
github = "tazjin";
|
||||
@@ -13629,12 +13903,6 @@
|
||||
githubId = 2164118;
|
||||
name = "Tobias Bora";
|
||||
};
|
||||
tohl = {
|
||||
email = "tom@logand.com";
|
||||
github = "tohl";
|
||||
githubId = 12159013;
|
||||
name = "Tomas Hlavaty";
|
||||
};
|
||||
tokudan = {
|
||||
email = "git@danielfrank.net";
|
||||
github = "tokudan";
|
||||
@@ -13975,17 +14243,23 @@
|
||||
name = "Urban Skudnik";
|
||||
};
|
||||
usrfriendly = {
|
||||
name = "Arin Lares";
|
||||
email = "arinlares@gmail.com";
|
||||
github = "usrfriendly";
|
||||
githubId = 2502060;
|
||||
};
|
||||
name = "Arin Lares";
|
||||
email = "arinlares@gmail.com";
|
||||
github = "usrfriendly";
|
||||
githubId = 2502060;
|
||||
};
|
||||
utdemir = {
|
||||
email = "me@utdemir.com";
|
||||
github = "utdemir";
|
||||
githubId = 928084;
|
||||
name = "Utku Demir";
|
||||
};
|
||||
uthar = {
|
||||
email = "galkowskikasper@gmail.com";
|
||||
github = "uthar";
|
||||
githubId = 15697697;
|
||||
name = "Kasper Gałkowski";
|
||||
};
|
||||
uvnikita = {
|
||||
email = "uv.nikita@gmail.com";
|
||||
github = "uvNikita";
|
||||
@@ -14388,6 +14662,12 @@
|
||||
fingerprint = "2145 955E 3F5E 0C95 3458 41B5 11F7 BAEA 8567 43FF";
|
||||
}];
|
||||
};
|
||||
wentam = {
|
||||
name = "Matt Egeler";
|
||||
email = "wentam42@gmail.com";
|
||||
github = "wentam";
|
||||
githubId = 901583;
|
||||
};
|
||||
wentasah = {
|
||||
name = "Michal Sojka";
|
||||
email = "wsh@2x.cz";
|
||||
@@ -15566,4 +15846,16 @@
|
||||
github = "quasigod-io";
|
||||
githubId = 62124625;
|
||||
};
|
||||
waelwindows = {
|
||||
email = "waelwindows9922@gmail.com";
|
||||
github = "Waelwindows";
|
||||
githubId = 5228243;
|
||||
name = "waelwindows";
|
||||
};
|
||||
wuyoli = {
|
||||
name = "wuyoli";
|
||||
email = "wuyoli@tilde.team";
|
||||
github = "wuyoli";
|
||||
githubId = 104238274;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -164,6 +164,7 @@ elsif (defined $expr) {
|
||||
my $algo = $fetch->{type};
|
||||
my $hash = $fetch->{hash};
|
||||
my $name = $fetch->{name};
|
||||
my $isPatch = $fetch->{isPatch};
|
||||
|
||||
if ($hash =~ /^([a-z0-9]+)-([A-Za-z0-9+\/=]+)$/) {
|
||||
$algo = $1;
|
||||
@@ -189,6 +190,11 @@ elsif (defined $expr) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($isPatch) {
|
||||
print STDERR "skipping $url (support for patches is missing)\n";
|
||||
next;
|
||||
}
|
||||
|
||||
next if defined $exclude && $url =~ /$exclude/;
|
||||
|
||||
if (alreadyMirrored($algo, $hash)) {
|
||||
|
||||
@@ -31,7 +31,7 @@ sub github_team_members {
|
||||
push @ret, $_->{'login'};
|
||||
}
|
||||
} else {
|
||||
print {*STDERR} "!! Requesting members of GitHub Team '$team_name' failed: $response->status_line";
|
||||
print {*STDERR} "!! Requesting members of GitHub Team '$team_name' failed: " . $response->status_line;
|
||||
}
|
||||
|
||||
return \@ret;
|
||||
|
||||
@@ -14,12 +14,12 @@ let
|
||||
operator = const [ ];
|
||||
});
|
||||
|
||||
urls = map (drv: { url = head (drv.urls or [ drv.url ]); hash = drv.outputHash; type = drv.outputHashAlgo; name = drv.name; }) fetchurlDependencies;
|
||||
urls = map (drv: { url = head (drv.urls or [ drv.url ]); hash = drv.outputHash; isPatch = (drv?postFetch && drv.postFetch != ""); type = drv.outputHashAlgo; name = drv.name; }) fetchurlDependencies;
|
||||
|
||||
fetchurlDependencies =
|
||||
filter
|
||||
(drv: drv.outputHash or "" != "" && drv.outputHashMode or "flat" == "flat"
|
||||
&& drv.postFetch or "" == "" && (drv ? url || drv ? urls))
|
||||
&& (drv ? url || drv ? urls))
|
||||
dependencies;
|
||||
|
||||
dependencies = map (x: x.value) (genericClosure {
|
||||
|
||||
@@ -14,4 +14,4 @@ commit="$(jq -r .commit.sha <<< "$head_info")"
|
||||
date="$(date "--date=$(jq -r .commit.commit.committer.date <<< "$head_info")" +%F)"
|
||||
# generate nix expression from cabal file, replacing the version with the commit date
|
||||
echo '# This file defines cabal2nix-unstable, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh.' > pkgs/development/haskell-modules/cabal2nix-unstable.nix
|
||||
cabal2nix "https://github.com/NixOS/cabal2nix/archive/$commit.tar.gz" | sed -e 's/version = ".*"/version = "'"unstable-$date"'"/' >> pkgs/development/haskell-modules/cabal2nix-unstable.nix
|
||||
cabal2nix --subpath cabal2nix "https://github.com/NixOS/cabal2nix/archive/$commit.tar.gz" | sed -e 's/version = ".*"/version = "'"unstable-$date"'"/' >> pkgs/development/haskell-modules/cabal2nix-unstable.nix
|
||||
|
||||
@@ -63,7 +63,7 @@ luaepnf,,,,,,
|
||||
luaevent,,,,,,
|
||||
luaexpat,,,,1.4.1-1,,arobyn flosse
|
||||
luaffi,,,http://luarocks.org/dev,,,
|
||||
luafilesystem,,,,1.7.0-2,,flosse
|
||||
luafilesystem,,,,1.8.0-1,,flosse
|
||||
lualogging,,,,,,
|
||||
luaossl,,,,,5.1,
|
||||
luaposix,,,,34.1.1-1,,vyp lblasc
|
||||
@@ -87,7 +87,7 @@ mediator_lua,,,,,,
|
||||
mpack,,,,,,
|
||||
moonscript,https://github.com/leafo/moonscript.git,dev-1,,,,arobyn
|
||||
nvim-client,https://github.com/neovim/lua-client.git,,,,,
|
||||
nvim-cmp,,,,,
|
||||
nvim-cmp,https://github.com/hrsh7th/nvim-cmp,,,,,
|
||||
penlight,https://github.com/lunarmodules/Penlight.git,,,,,alerque
|
||||
plenary.nvim,https://github.com/nvim-lua/plenary.nvim.git,,,,5.1,
|
||||
rapidjson,https://github.com/xpol/lua-rapidjson.git,,,,,
|
||||
@@ -101,3 +101,4 @@ std.normalize,https://github.com/lua-stdlib/normalize.git,,,,,
|
||||
stdlib,,,,41.2.2,,vyp
|
||||
tl,,,,,,mephistophiles
|
||||
vstruct,https://github.com/ToxicFrog/vstruct.git,,,,,
|
||||
vusted,,,,,,figsoda
|
||||
|
||||
|
@@ -61,12 +61,12 @@ Readonly::Hash my %LICENSE_MAP => (
|
||||
|
||||
# GNU Free Documentation License, Version 1.2.
|
||||
gfdl_1_2 => {
|
||||
licenses => [qw( fdl12 )]
|
||||
licenses => [qw( fdl12Plus )]
|
||||
},
|
||||
|
||||
# GNU Free Documentation License, Version 1.3.
|
||||
gfdl_1_3 => {
|
||||
licenses => [qw( fdl13 )]
|
||||
licenses => [qw( fdl13Plus )]
|
||||
},
|
||||
|
||||
# GNU General Public License, Version 1.
|
||||
|
||||
@@ -342,6 +342,7 @@ class Editor:
|
||||
self.default_out = default_out or root.joinpath("generated.nix")
|
||||
self.deprecated = deprecated or root.joinpath("deprecated.json")
|
||||
self.cache_file = cache_file or f"{name}-plugin-cache.json"
|
||||
self.nixpkgs_repo = None
|
||||
|
||||
def get_current_plugins(self) -> List[Plugin]:
|
||||
"""To fill the cache"""
|
||||
@@ -670,16 +671,15 @@ def update_plugins(editor: Editor, args):
|
||||
|
||||
autocommit = not args.no_commit
|
||||
|
||||
nixpkgs_repo = None
|
||||
if autocommit:
|
||||
nixpkgs_repo = git.Repo(editor.root, search_parent_directories=True)
|
||||
commit(nixpkgs_repo, f"{editor.attr_path}: update", [args.outfile])
|
||||
editor.nixpkgs_repo = git.Repo(editor.root, search_parent_directories=True)
|
||||
commit(editor.nixpkgs_repo, f"{editor.attr_path}: update", [args.outfile])
|
||||
|
||||
if redirects:
|
||||
update()
|
||||
if autocommit:
|
||||
commit(
|
||||
nixpkgs_repo,
|
||||
editor.nixpkgs_repo,
|
||||
f"{editor.attr_path}: resolve github repository redirects",
|
||||
[args.outfile, args.input_file, editor.deprecated],
|
||||
)
|
||||
@@ -692,7 +692,7 @@ def update_plugins(editor: Editor, args):
|
||||
plugin, _ = prefetch_plugin(pdesc, )
|
||||
if autocommit:
|
||||
commit(
|
||||
nixpkgs_repo,
|
||||
editor.nixpkgs_repo,
|
||||
"{drv_name}: init at {version}".format(
|
||||
drv_name=editor.get_drv_name(plugin.normalized_name),
|
||||
version=plugin.version
|
||||
|
||||
@@ -48,7 +48,17 @@ let
|
||||
let
|
||||
result = builtins.tryEval pathContent;
|
||||
|
||||
dedupResults = lst: nubOn ({ package, attrPath }: package.updateScript) (lib.concatLists lst);
|
||||
somewhatUniqueRepresentant =
|
||||
{ package, attrPath }: {
|
||||
inherit (package) updateScript;
|
||||
# Some updaters use the same `updateScript` value for all packages.
|
||||
# Also compare `meta.description`.
|
||||
position = package.meta.position or null;
|
||||
# We cannot always use `meta.position` since it might not be available
|
||||
# or it might be shared among multiple packages.
|
||||
};
|
||||
|
||||
dedupResults = lst: nubOn somewhatUniqueRepresentant (lib.concatLists lst);
|
||||
in
|
||||
if result.success then
|
||||
let
|
||||
|
||||
@@ -121,7 +121,7 @@ with lib.maintainers; {
|
||||
bobby285271
|
||||
mkg20001
|
||||
];
|
||||
scope = "Maintain Cinnamon desktop environment and applications made by the LinuxMint team.";
|
||||
scope = "Maintain Cinnamon desktop environment and applications made by the Linux Mint team.";
|
||||
shortName = "Cinnamon";
|
||||
enableFeatureFreezePing = true;
|
||||
};
|
||||
@@ -182,6 +182,8 @@ with lib.maintainers; {
|
||||
members = [
|
||||
cole-h
|
||||
grahamc
|
||||
hoverbear
|
||||
lheckemann
|
||||
];
|
||||
scope = "Group registration for packages maintained by Determinate Systems.";
|
||||
shortName = "Determinate Systems employees";
|
||||
@@ -629,6 +631,18 @@ with lib.maintainers; {
|
||||
shortName = "Release";
|
||||
};
|
||||
|
||||
rocm = {
|
||||
members = [
|
||||
Madouura
|
||||
Flakebi
|
||||
];
|
||||
githubTeams = [
|
||||
"rocm-maintainers"
|
||||
];
|
||||
scope = "Maintain ROCm and related packages.";
|
||||
shortName = "ROCm";
|
||||
};
|
||||
|
||||
ruby = {
|
||||
members = [
|
||||
marsam
|
||||
@@ -673,7 +687,6 @@ with lib.maintainers; {
|
||||
# Verify additions by approval of an already existing member of the team.
|
||||
members = [
|
||||
balsoft
|
||||
mkaito
|
||||
];
|
||||
scope = "Group registration for Serokell employees who collectively maintain packages.";
|
||||
shortName = "Serokell employees";
|
||||
|
||||
@@ -43,14 +43,6 @@ Note: Assigning either role will also default both
|
||||
and [](#opt-services.kubernetes.easyCerts)
|
||||
to true. This sets up flannel as CNI and activates automatic PKI bootstrapping.
|
||||
|
||||
As of kubernetes 1.10.X it has been deprecated to open non-tls-enabled
|
||||
ports on kubernetes components. Thus, from NixOS 19.03 all plain HTTP
|
||||
ports have been disabled by default. While opening insecure ports is
|
||||
still possible, it is recommended not to bind these to other interfaces
|
||||
than loopback. To re-enable the insecure port on the apiserver, see options:
|
||||
[](#opt-services.kubernetes.apiserver.insecurePort) and
|
||||
[](#opt-services.kubernetes.apiserver.insecureBindAddress)
|
||||
|
||||
::: {.note}
|
||||
As of NixOS 19.03, it is mandatory to configure:
|
||||
[](#opt-services.kubernetes.masterAddress).
|
||||
|
||||
@@ -11,7 +11,7 @@ options = {
|
||||
type = type specification;
|
||||
default = default value;
|
||||
example = example value;
|
||||
description = "Description for use in the NixOS manual.";
|
||||
description = lib.mdDoc "Description for use in the NixOS manual.";
|
||||
};
|
||||
};
|
||||
```
|
||||
@@ -59,8 +59,9 @@ The function `mkOption` accepts the following arguments.
|
||||
: A textual description of the option, in [Nixpkgs-flavored Markdown](
|
||||
https://nixos.org/nixpkgs/manual/#sec-contributing-markup) format, that will be
|
||||
included in the NixOS manual. During the migration process from DocBook
|
||||
to CommonMark the description may also be written in DocBook, but this is
|
||||
discouraged.
|
||||
it is necessary to mark descriptions written in CommonMark with `lib.mdDoc`.
|
||||
The description may still be written in DocBook (without any marker), but this
|
||||
is discouraged and will be deprecated in the future.
|
||||
|
||||
## Utility functions for common option patterns {#sec-option-declarations-util}
|
||||
|
||||
@@ -83,7 +84,7 @@ lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether to enable magic.";
|
||||
description = lib.mdDoc "Whether to enable magic.";
|
||||
}
|
||||
```
|
||||
|
||||
@@ -116,7 +117,7 @@ lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.hello;
|
||||
defaultText = lib.literalExpression "pkgs.hello";
|
||||
description = "The hello package to use.";
|
||||
description = lib.mdDoc "The hello package to use.";
|
||||
}
|
||||
```
|
||||
|
||||
@@ -132,7 +133,7 @@ lib.mkOption {
|
||||
default = pkgs.ghc;
|
||||
defaultText = lib.literalExpression "pkgs.ghc";
|
||||
example = lib.literalExpression "pkgs.haskell.packages.ghc92.ghc.withPackages (hkgs: [ hkgs.primes ])";
|
||||
description = "The GHC package to use.";
|
||||
description = lib.mdDoc "The GHC package to use.";
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -47,17 +47,6 @@ services.kubernetes.roles = [ "master" "node" ];
|
||||
<xref linkend="opt-services.kubernetes.easyCerts" /> to true. This
|
||||
sets up flannel as CNI and activates automatic PKI bootstrapping.
|
||||
</para>
|
||||
<para>
|
||||
As of kubernetes 1.10.X it has been deprecated to open
|
||||
non-tls-enabled ports on kubernetes components. Thus, from NixOS
|
||||
19.03 all plain HTTP ports have been disabled by default. While
|
||||
opening insecure ports is still possible, it is recommended not to
|
||||
bind these to other interfaces than loopback. To re-enable the
|
||||
insecure port on the apiserver, see options:
|
||||
<xref linkend="opt-services.kubernetes.apiserver.insecurePort" />
|
||||
and
|
||||
<xref linkend="opt-services.kubernetes.apiserver.insecureBindAddress" />
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
As of NixOS 19.03, it is mandatory to configure:
|
||||
|
||||
@@ -12,7 +12,7 @@ options = {
|
||||
type = type specification;
|
||||
default = default value;
|
||||
example = example value;
|
||||
description = "Description for use in the NixOS manual.";
|
||||
description = lib.mdDoc "Description for use in the NixOS manual.";
|
||||
};
|
||||
};
|
||||
</programlisting>
|
||||
@@ -98,9 +98,11 @@ options = {
|
||||
A textual description of the option, in
|
||||
<link xlink:href="https://nixos.org/nixpkgs/manual/#sec-contributing-markup">Nixpkgs-flavored
|
||||
Markdown</link> format, that will be included in the NixOS
|
||||
manual. During the migration process from DocBook to
|
||||
CommonMark the description may also be written in DocBook, but
|
||||
this is discouraged.
|
||||
manual. During the migration process from DocBook it is
|
||||
necessary to mark descriptions written in CommonMark with
|
||||
<literal>lib.mdDoc</literal>. The description may still be
|
||||
written in DocBook (without any marker), but this is
|
||||
discouraged and will be deprecated in the future.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -132,7 +134,7 @@ lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether to enable magic.";
|
||||
description = lib.mdDoc "Whether to enable magic.";
|
||||
}
|
||||
</programlisting>
|
||||
<section xml:id="sec-option-declarations-util-mkPackageOption">
|
||||
@@ -182,7 +184,7 @@ lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.hello;
|
||||
defaultText = lib.literalExpression "pkgs.hello";
|
||||
description = "The hello package to use.";
|
||||
description = lib.mdDoc "The hello package to use.";
|
||||
}
|
||||
</programlisting>
|
||||
<anchor xml:id="ex-options-declarations-util-mkPackageOption-ghc" />
|
||||
@@ -197,7 +199,7 @@ lib.mkOption {
|
||||
default = pkgs.ghc;
|
||||
defaultText = lib.literalExpression "pkgs.ghc";
|
||||
example = lib.literalExpression "pkgs.haskell.packages.ghc92.ghc.withPackages (hkgs: [ hkgs.primes ])";
|
||||
description = "The GHC package to use.";
|
||||
description = lib.mdDoc "The GHC package to use.";
|
||||
}
|
||||
</programlisting>
|
||||
<section xml:id="sec-option-declarations-eot">
|
||||
|
||||
@@ -1,35 +1,135 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-booting-from-usb">
|
||||
<title>Booting from a USB Drive</title>
|
||||
<title>Booting from a USB flash drive</title>
|
||||
<para>
|
||||
For systems without CD drive, the NixOS live CD can be booted from a
|
||||
USB stick. You can use the <literal>dd</literal> utility to write
|
||||
the image: <literal>dd if=path-to-image of=/dev/sdX</literal>. Be
|
||||
careful about specifying the correct drive; you can use the
|
||||
<literal>lsblk</literal> command to get a list of block devices.
|
||||
The image has to be written verbatim to the USB flash drive for it
|
||||
to be bootable on UEFI and BIOS systems. Here are the recommended
|
||||
tools to do that.
|
||||
</para>
|
||||
<note>
|
||||
<title>On macOS</title>
|
||||
<section xml:id="sec-booting-from-usb-graphical">
|
||||
<title>Creating bootable USB flash drive with a graphical
|
||||
tool</title>
|
||||
<para>
|
||||
Etcher is a popular and user-friendly tool. It works on Linux,
|
||||
Windows and macOS.
|
||||
</para>
|
||||
<para>
|
||||
Download it from
|
||||
<link xlink:href="https://www.balena.io/etcher/">balena.io</link>,
|
||||
start the program, select the downloaded NixOS ISO, then select
|
||||
the USB flash drive and flash it.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
Etcher reports errors and usage statistics by default, which can
|
||||
be disabled in the settings.
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
An alternative is
|
||||
<link xlink:href="https://bztsrc.gitlab.io/usbimager">USBImager</link>,
|
||||
which is very simple and does not connect to the internet.
|
||||
Download the version with write-only (wo) interface for your
|
||||
system. Start the program, select the image, select the USB flash
|
||||
drive and click <quote>Write</quote>.
|
||||
</para>
|
||||
</section>
|
||||
<section xml:id="sec-booting-from-usb-linux">
|
||||
<title>Creating bootable USB flash drive from a Terminal on
|
||||
Linux</title>
|
||||
<orderedlist numeration="arabic" spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
Plug in the USB flash drive.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Find the corresponding device with <literal>lsblk</literal>.
|
||||
You can distinguish them by their size.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Make sure all partitions on the device are properly unmounted.
|
||||
Replace <literal>sdX</literal> with your device (e.g.
|
||||
<literal>sdb</literal>).
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<programlisting>
|
||||
$ diskutil list
|
||||
[..]
|
||||
/dev/diskN (external, physical):
|
||||
#: TYPE NAME SIZE IDENTIFIER
|
||||
[..]
|
||||
$ diskutil unmountDisk diskN
|
||||
Unmount of all volumes on diskN was successful
|
||||
$ sudo dd if=nix.iso of=/dev/rdiskN bs=1M
|
||||
sudo umount /dev/sdX*
|
||||
</programlisting>
|
||||
<orderedlist numeration="arabic" spacing="compact">
|
||||
<listitem override="4">
|
||||
<para>
|
||||
Then use the <literal>dd</literal> utility to write the image
|
||||
to the USB flash drive.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<programlisting>
|
||||
sudo dd if=<path-to-image> of=/dev/sdX bs=4M conv=fsync
|
||||
</programlisting>
|
||||
</section>
|
||||
<section xml:id="sec-booting-from-usb-macos">
|
||||
<title>Creating bootable USB flash drive from a Terminal on
|
||||
macOS</title>
|
||||
<orderedlist numeration="arabic" spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
Plug in the USB flash drive.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Find the corresponding device with
|
||||
<literal>diskutil list</literal>. You can distinguish them by
|
||||
their size.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Make sure all partitions on the device are properly unmounted.
|
||||
Replace <literal>diskX</literal> with your device (e.g.
|
||||
<literal>disk1</literal>).
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<programlisting>
|
||||
diskutil unmountDisk diskX
|
||||
</programlisting>
|
||||
<orderedlist numeration="arabic" spacing="compact">
|
||||
<listitem override="4">
|
||||
<para>
|
||||
Then use the <literal>dd</literal> utility to write the image
|
||||
to the USB flash drive.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<programlisting>
|
||||
sudo dd if=<path-to-image> of=/dev/rdiskX bs=4m
|
||||
</programlisting>
|
||||
<para>
|
||||
Using the 'raw' <literal>rdiskN</literal> device instead of
|
||||
<literal>diskN</literal> completes in minutes instead of hours.
|
||||
After <literal>dd</literal> completes, a GUI dialog "The disk
|
||||
you inserted was not readable by this computer" will pop up,
|
||||
which can be ignored.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
The <literal>dd</literal> utility will write the image verbatim to
|
||||
the drive, making it the recommended option for both UEFI and
|
||||
non-UEFI installations.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Using the 'raw' <literal>rdiskX</literal> device instead of
|
||||
<literal>diskX</literal> with dd completes in minutes instead of
|
||||
hours.
|
||||
</para>
|
||||
</note>
|
||||
<orderedlist numeration="arabic" spacing="compact">
|
||||
<listitem override="5">
|
||||
<para>
|
||||
Eject the disk when it is finished.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<programlisting>
|
||||
diskutil eject /dev/diskX
|
||||
</programlisting>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,16 +2,15 @@
|
||||
<title>Obtaining NixOS</title>
|
||||
<para>
|
||||
NixOS ISO images can be downloaded from the
|
||||
<link xlink:href="https://nixos.org/nixos/download.html">NixOS
|
||||
download page</link>. There are a number of installation options. If
|
||||
you happen to have an optical drive and a spare CD, burning the
|
||||
image to CD and booting from that is probably the easiest option.
|
||||
Most people will need to prepare a USB stick to boot from.
|
||||
<xref linkend="sec-booting-from-usb" /> describes the preferred
|
||||
method to prepare a USB stick. A number of alternative methods are
|
||||
presented in the
|
||||
<link xlink:href="https://nixos.wiki/wiki/NixOS_Installation_Guide#Making_the_installation_media">NixOS
|
||||
Wiki</link>.
|
||||
<link xlink:href="https://nixos.org/download.html#nixos-iso">NixOS
|
||||
download page</link>. Follow the instructions in
|
||||
<xref linkend="sec-booting-from-usb" /> to create a bootable USB
|
||||
flash drive.
|
||||
</para>
|
||||
<para>
|
||||
If you have a very old system that can’t boot from USB, you can burn
|
||||
the image to an empty CD. NixOS might not work very well on such
|
||||
systems.
|
||||
</para>
|
||||
<para>
|
||||
As an alternative to installing NixOS yourself, you can get a
|
||||
@@ -23,16 +22,16 @@
|
||||
Using virtual appliances in Open Virtualization Format (OVF)
|
||||
that can be imported into VirtualBox. These are available from
|
||||
the
|
||||
<link xlink:href="https://nixos.org/nixos/download.html">NixOS
|
||||
<link xlink:href="https://nixos.org/download.html#nixos-virtualbox">NixOS
|
||||
download page</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Using AMIs for Amazon’s EC2. To find one for your region and
|
||||
instance type, please refer to the
|
||||
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/ec2-amis.nix">list
|
||||
of most recent AMIs</link>.
|
||||
Using AMIs for Amazon’s EC2. To find one for your region, please
|
||||
refer to the
|
||||
<link xlink:href="https://nixos.org/download.html#nixos-amazon">download
|
||||
page</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
|
||||
@@ -2106,7 +2106,7 @@ Superuser created successfully.
|
||||
<literal>ghc810</literal>. Those attributes point to the same
|
||||
compilers and packagesets but have the advantage that e.g.
|
||||
<literal>ghc92</literal> stays stable when we update from
|
||||
<literal>ghc924</literal> to <literal>ghc925</literal>.
|
||||
<literal>ghc925</literal> to <literal>ghc926</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
@@ -1501,18 +1501,18 @@
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
MultiMC has been replaced with the fork PolyMC due to upstream
|
||||
developers being hostile to 3rd party package maintainers.
|
||||
PolyMC removes all MultiMC branding and is aimed at providing
|
||||
proper 3rd party packages like the one contained in Nixpkgs.
|
||||
This change affects the data folder where game instances and
|
||||
other save and configuration files are stored. Users with
|
||||
existing installations should rename
|
||||
MultiMC has been replaced with the fork PrismLauncher due to
|
||||
upstream developers being hostile to 3rd party package
|
||||
maintainers. PrismLauncher removes all MultiMC branding and is
|
||||
aimed at providing proper 3rd party packages like the one
|
||||
contained in Nixpkgs. This change affects the data folder
|
||||
where game instances and other save and configuration files
|
||||
are stored. Users with existing installations should rename
|
||||
<literal>~/.local/share/multimc</literal> to
|
||||
<literal>~/.local/share/polymc</literal>. The main config
|
||||
file’s path has also moved from
|
||||
<literal>~/.local/share/PrismLauncher</literal>. The main
|
||||
config file’s path has also moved from
|
||||
<literal>~/.local/share/multimc/multimc.cfg</literal> to
|
||||
<literal>~/.local/share/polymc/polymc.cfg</literal>.
|
||||
<literal>~/.local/share/PrismLauncher/prismlauncher.cfg</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@@ -2526,10 +2526,9 @@ sudo cp /var/lib/redis/dump.rdb /var/lib/redis-peertube/dump.rdb
|
||||
<listitem>
|
||||
<para>
|
||||
The logrotate module also has been updated to freeform syntax:
|
||||
<link linkend="opt-services.logrotate.paths">services.logrotate.paths</link>
|
||||
and
|
||||
<link linkend="opt-services.logrotate.extraConfig">services.logrotate.extraConfig</link>
|
||||
will work, but issue deprecation warnings and
|
||||
<literal>services.logrotate.paths</literal> and
|
||||
<literal>services.logrotate.extraConfig</literal> will work,
|
||||
but issue deprecation warnings and
|
||||
<link linkend="opt-services.logrotate.settings">services.logrotate.settings</link>
|
||||
should now be used instead.
|
||||
</para>
|
||||
|
||||
@@ -11,6 +11,13 @@
|
||||
has the following highlights:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
GNOME has been upgraded to 43. Please take a look at their
|
||||
<link xlink:href="https://release.gnome.org/43/">Release
|
||||
Notes</link> for details.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
During cross-compilation, tests are now executed if the test
|
||||
@@ -123,6 +130,22 @@
|
||||
PHP now defaults to PHP 8.1, updated from 8.0.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
PHP is now built <literal>NTS</literal> (Non-Thread Safe)
|
||||
style by default, for Apache and <literal>mod_php</literal>
|
||||
usage we still enable <literal>ZTS</literal> (Zend Thread
|
||||
Safe). This has been a common practice for a long time in
|
||||
other distributions.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>protonup</literal> has been aliased to and replaced
|
||||
by <literal>protonup-ng</literal> due to upstream not
|
||||
maintaining it.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Perl has been updated to 5.36, and its core module
|
||||
@@ -182,6 +205,15 @@
|
||||
<link xlink:href="options.html#opt-virtualisation.appvm.enable">virtualisation.appvm</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
[xray] (https://github.com/XTLS/Xray-core), a fully compatible
|
||||
v2ray-core replacement. Features XTLS, which when enabled on
|
||||
server and client, brings UDP FullCone NAT to proxy setups.
|
||||
Available as
|
||||
<link xlink:href="options.html#opt-services.xray.enable">services.xray</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://github.com/mozilla-services/syncstorage-rs">syncstorage-rs</link>,
|
||||
@@ -218,6 +250,13 @@
|
||||
<link xlink:href="options.html#opt-services.hadoop.hbase.enable">services.hadoop.hbase</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://github.com/edneville/please">Please</link>,
|
||||
a Sudo clone written in Rust. Available as
|
||||
<link linkend="opt-security.please.enable">security.please</link>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://github.com/messagebird/sachet/">Sachet</link>,
|
||||
@@ -249,6 +288,13 @@
|
||||
<link xlink:href="options.html#opt-services.kanata.enable">services.kanata</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://github.com/prymitive/karma">karma</link>,
|
||||
an alert dashboard for Prometheus Alertmanager. Available as
|
||||
<link xlink:href="options.html#opt-services.karma.enable">services.karma</link>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://languagetool.org/">languagetool</link>,
|
||||
@@ -270,6 +316,13 @@
|
||||
<link linkend="opt-services.outline.enable">services.outline</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://ntfy.sh">ntfy.sh</link>, a push
|
||||
notification service. Available as
|
||||
<link linkend="opt-services.ntfy-sh.enable">services.ntfy-sh</link>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://git.sr.ht/~migadu/alps">alps</link>,
|
||||
@@ -277,6 +330,13 @@
|
||||
<link linkend="opt-services.alps.enable">services.alps</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://github.com/skeeto/endlessh">endlessh</link>,
|
||||
an SSH tarpit. Available as
|
||||
<link linkend="opt-services.endlessh.enable">services.endlessh</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://github.com/shizunge/endlessh-go">endlessh-go</link>,
|
||||
@@ -284,6 +344,14 @@
|
||||
<link linkend="opt-services.endlessh-go.enable">services.endlessh-go</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://garagehq.deuxfleurs.fr/">Garage</link>,
|
||||
a simple object storage server for geodistributed deployments,
|
||||
alternative to MinIO. Available as
|
||||
<link linkend="opt-services.garage.enable">services.garage</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://netbird.io">netbird</link>, a zero
|
||||
@@ -329,6 +397,13 @@
|
||||
<link linkend="opt-services.expressvpn.enable">services.expressvpn</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://troglobit.com/projects/merecat/">merecat</link>,
|
||||
a small and easy HTTP server based on thttpd. Available as
|
||||
<link linkend="opt-services.merecat.enable">services.merecat</link>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://github.com/L11R/go-autoconfig">go-autoconfig</link>,
|
||||
@@ -391,6 +466,21 @@
|
||||
<link xlink:href="options.html#opt-services.listmonk.enable">services.listmonk</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://uptime.kuma.pet/">Uptime
|
||||
Kuma</link>, a fancy self-hosted monitoring tool. Available as
|
||||
<link linkend="opt-services.uptime-kuma.enable">services.uptime-kuma</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://mepo.milesalan.com">Mepo</link>, a
|
||||
fast, simple, hackable OSM map viewer for mobile and desktop
|
||||
Linux. Available as
|
||||
<link linkend="opt-programs.mepo.enable">programs.mepo.enable</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section xml:id="sec-release-22.11-incompatibilities">
|
||||
@@ -441,6 +531,15 @@
|
||||
<literal>[ "all" ]</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Deprecated settings <literal>logrotate.paths</literal> and
|
||||
<literal>logrotate.extraConfig</literal> have been removed.
|
||||
Please convert any uses to
|
||||
<link linkend="opt-services.logrotate.settings">services.logrotate.settings</link>
|
||||
instead.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>isPowerPC</literal> predicate, found on
|
||||
@@ -507,6 +606,16 @@
|
||||
instead.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>p4</literal> package now only includes the
|
||||
open-source Perforce Helix Core command-line client and APIs.
|
||||
It no longer installs the unfree Helix Core Server binaries
|
||||
<literal>p4d</literal>, <literal>p4broker</literal>, and
|
||||
<literal>p4p</literal>. To install the Helix Core Server
|
||||
binaries, use the <literal>p4d</literal> package instead.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>coq</literal> package and versioned variants
|
||||
@@ -524,6 +633,17 @@
|
||||
this version for the entire lifecycle of the 22.11 release.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The ipfs package and module were renamed to kubo. The kubo
|
||||
module now uses an RFC42-style <literal>settings</literal>
|
||||
option instead of <literal>extraConfig</literal> and the
|
||||
<literal>gatewayAddress</literal>,
|
||||
<literal>apiAddress</literal> and
|
||||
<literal>swarmAddress</literal> options were renamed. Using
|
||||
the old names will print a warning but still work.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>pkgs.cosign</literal> does not provide the
|
||||
@@ -547,6 +667,15 @@
|
||||
maintainer to update the package.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
ppd files in <literal>pkgs.cups-drv-rastertosag-gdi</literal>
|
||||
are now gzipped. If you refer to such a ppd file with its path
|
||||
(e.g. via
|
||||
<link xlink:href="options.html#opt-hardware.printers.ensurePrinters">hardware.printers.ensurePrinters</link>)
|
||||
you will need to append <literal>.gz</literal> to the path.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
xow package removed along with the
|
||||
@@ -594,6 +723,35 @@
|
||||
module removed, due to lack of maintainers.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>nix.checkConfig</literal> option now fully
|
||||
disables the config check. The new
|
||||
<literal>nix.checkAllErrors</literal> option behaves like
|
||||
<literal>nix.checkConfig</literal> previously did.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>generateOptparseApplicativeCompletions</literal> and
|
||||
<literal>generateOptparseApplicativeCompletion</literal> from
|
||||
<literal>haskell.lib.compose</literal> (and
|
||||
<literal>haskell.lib</literal>) have been deprecated in favor
|
||||
of <literal>generateOptparseApplicativeCompletions</literal>
|
||||
(plural!) as provided by the haskell package sets (so
|
||||
<literal>haskellPackages.generateOptparseApplicativeCompletions</literal>
|
||||
etc.). The latter allows for cross-compilation (by
|
||||
automatically disabling generation of completion in the cross
|
||||
case). For it to work properly you need to make sure that the
|
||||
function comes from the same context as the package you are
|
||||
trying to override, i.e. always use the same package set as
|
||||
your package is coming from or – even better – use
|
||||
<literal>self.generateOptparseApplicativeCompletions</literal>
|
||||
if you are overriding a haskell package set. The old functions
|
||||
are retained for backwards compatibility, but yield are
|
||||
warning.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>services.graphite.api</literal> and
|
||||
@@ -604,6 +762,13 @@
|
||||
been removed due to lack of upstream maintenance.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>trace</literal> binary from
|
||||
<literal>perf-linux</literal> package has been removed, due to
|
||||
being a duplicate of the <literal>perf</literal> binary.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>aws</literal> package has been removed due to
|
||||
@@ -612,6 +777,79 @@
|
||||
instead.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The
|
||||
<link xlink:href="https://ce-programming.github.io/CEmu">CEmu
|
||||
TI-84 Plus CE emulator</link> package has been renamed to
|
||||
<literal>cemu-ti</literal>. The
|
||||
<link xlink:href="https://cemu.info">Cemu Wii U
|
||||
emulator</link> is now packaged as <literal>cemu</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>systemd-networkd</literal> v250 deprecated, renamed,
|
||||
and moved some sections and settings which leads to the
|
||||
following breaking module changes:
|
||||
</para>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>systemd.network.networks.<name>.dhcpV6PrefixDelegationConfig</literal>
|
||||
is renamed to
|
||||
<literal>systemd.network.networks.<name>.dhcpPrefixDelegationConfig</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>systemd.network.networks.<name>.dhcpV6Config</literal>
|
||||
no longer accepts the
|
||||
<literal>ForceDHCPv6PDOtherInformation=</literal> setting.
|
||||
Please use the <literal>WithoutRA=</literal> and
|
||||
<literal>UseDelegatedPrefix=</literal> settings in your
|
||||
<literal>systemd.network.networks.<name>.dhcpV6Config</literal>
|
||||
and the <literal>DHCPv6Client=</literal> setting in your
|
||||
<literal>systemd.network.networks.<name>.ipv6AcceptRAConfig</literal>
|
||||
to control when the DHCPv6 client is started and how the
|
||||
delegated prefixes are handled by the DHCPv6 client.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>systemd.network.networks.<name>.networkConfig</literal>
|
||||
no longer accepts the <literal>IPv6Token=</literal>
|
||||
setting. Use the <literal>Token=</literal> setting in your
|
||||
<literal>systemd.network.networks.<name>.ipv6AcceptRAConfig</literal>
|
||||
instead. The
|
||||
<literal>systemd.network.networks.<name>.ipv6Prefixes.*.ipv6PrefixConfig</literal>
|
||||
now also accepts the <literal>Token=</literal> setting.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>arangodb</literal> versions 3.3, 3.4, and 3.5 have
|
||||
been removed because they are at EOL upstream. The default is
|
||||
now 3.10.0. Support for aarch64-linux has been removed since
|
||||
the target cannot be built reproducibly. By default
|
||||
<literal>arangodb</literal> is now built for the
|
||||
<literal>haswell</literal> architecture. If you wish to build
|
||||
for a different architecture, you may override the
|
||||
<literal>targetArchitecture</literal> argument with a value
|
||||
from
|
||||
<link xlink:href="https://github.com/arangodb/arangodb/blob/207ec6937e41a46e10aea34953879341f0606841/cmake/OptimizeForArchitecture.cmake#L594">this
|
||||
list supported upstream</link>. Some architecture specific
|
||||
optimizations are also conditionally enabled. You may alter
|
||||
this behavior by overriding the
|
||||
<literal>asmOptimizations</literal> parameter. You may also
|
||||
add additional architecture support by adding more
|
||||
<literal>-DHAS_XYZ</literal> flags to
|
||||
<literal>cmakeFlags</literal> via
|
||||
<literal>overrideAttrs</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>meta.mainProgram</literal> attribute of packages
|
||||
@@ -626,6 +864,18 @@
|
||||
system timezone.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The top-level <literal>termonad-with-packages</literal> alias
|
||||
for <literal>termonad</literal> has been removed.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Linux 4.9 has been removed because it will reach its end of
|
||||
life within the lifespan of 22.11.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
(Neo)Vim can not be configured with
|
||||
@@ -640,18 +890,99 @@
|
||||
for vim).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>adguardhome</literal> module no longer uses
|
||||
<literal>host</literal> and <literal>port</literal> options,
|
||||
use <literal>settings.bind_host</literal> and
|
||||
<literal>settings.bind_port</literal> instead.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The default <literal>kops</literal> version is now 1.25.1 and
|
||||
support for 1.22 and older has been dropped.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>zrepl</literal> package has been updated from
|
||||
0.5.0 to 0.6.0. See the
|
||||
<link xlink:href="https://zrepl.github.io/changelog.html">changelog</link>
|
||||
for details.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>k3s</literal> no longer supports docker as runtime
|
||||
due to upstream dropping support.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>cassandra_2_1</literal> and
|
||||
<literal>cassandra_2_2</literal> have been removed. Please
|
||||
update to <literal>cassandra_3_11</literal> or
|
||||
<literal>cassandra_3_0</literal>. See the
|
||||
<link xlink:href="https://github.com/apache/cassandra/blob/cassandra-3.11.14/NEWS.txt">changelog</link>
|
||||
for more information about the upgrade process.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>mysql57</literal> has been removed. Please update to
|
||||
<literal>mysql80</literal> or <literal>mariadb</literal>. See
|
||||
the
|
||||
<link xlink:href="https://mariadb.com/kb/en/upgrading-from-mysql-to-mariadb/">upgrade
|
||||
guide</link> for more information.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Consequently, <literal>cqrlog</literal> and
|
||||
<literal>amorok</literal> now use <literal>mariadb</literal>
|
||||
instead of <literal>mysql57</literal> for their embedded
|
||||
databases. Running <literal>mysql_upgrade</literal> may be
|
||||
neccesary.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>k3s</literal> supports <literal>clusterInit</literal>
|
||||
option, and it is enabled by default, for servers.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>percona-server56</literal> has been removed. Please
|
||||
migrate to <literal>mysql</literal> or
|
||||
<literal>mariadb</literal> if possible.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>obs-studio</literal> hase been updated to version 28.
|
||||
If you have packaged custom plugins, check if they are
|
||||
compatible. <literal>obs-websocket</literal> has been
|
||||
integrated into <literal>obs-studio</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>signald</literal> has been bumped to
|
||||
<literal>0.23.0</literal>. For the upgrade, a migration
|
||||
process is necessary. It can be done by running a command like
|
||||
this before starting <literal>signald.service</literal>:
|
||||
</para>
|
||||
<programlisting>
|
||||
signald -d /var/lib/signald/db \
|
||||
--database sqlite:/var/lib/signald/db \
|
||||
--migrate-data
|
||||
</programlisting>
|
||||
<para>
|
||||
For further information, please read the upstream changelogs.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>stylua</literal> no longer accepts
|
||||
@@ -661,6 +992,26 @@
|
||||
<literal>[ "lua54" "luau" ]</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>pkgs.fetchNextcloudApp</literal> has been rewritten
|
||||
to circumvent impurities in e.g. tarballs from GitHub and to
|
||||
make it easier to apply patches. This means that your hashes
|
||||
are out-of-date and the (previously required) attributes
|
||||
<literal>name</literal> and <literal>version</literal> are no
|
||||
longer accepted.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The Syncthing service now only allows absolute paths—starting
|
||||
with <literal>/</literal> or <literal>~/</literal>—for
|
||||
<literal>services.syncthing.folders.<name>.path</literal>.
|
||||
In a future release other paths will be allowed again and
|
||||
interpreted relative to
|
||||
<literal>services.syncthing.dataDir</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section xml:id="sec-release-22.11-notable-changes">
|
||||
@@ -692,6 +1043,25 @@
|
||||
<literal>hardware.saleae-logic.package</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
ZFS module will not allow hibernation by default, this is a
|
||||
safety measure to prevent data loss cases like the ones
|
||||
described at
|
||||
<link xlink:href="https://github.com/openzfs/zfs/issues/260">OpenZFS/260</link>
|
||||
and
|
||||
<link xlink:href="https://github.com/openzfs/zfs/issues/12842">OpenZFS/12842</link>.
|
||||
Use the <literal>boot.zfs.allowHibernation</literal> option to
|
||||
configure this behaviour.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>mastodon</literal> now automatically removes remote
|
||||
media attachments older than 30 days. This is configurable
|
||||
through <literal>services.mastodon.mediaAutoRemove</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The Redis module now disables RDB persistence when
|
||||
@@ -712,12 +1082,84 @@
|
||||
the mtu on interfaces and tag its packets with an fwmark.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The option <literal>overrideStrategy</literal> was added to
|
||||
the different systemd unit options
|
||||
(<literal>systemd.services.<name></literal>,
|
||||
<literal>systemd.sockets.<name></literal>, …) to allow
|
||||
enforcing the creation of a dropin file, rather than the main
|
||||
unit file, by setting it to <literal>asDropin</literal>. This
|
||||
is useful in cases where the existence of the main unit file
|
||||
is not known to Nix at evaluation time, for example when the
|
||||
main unit file is provided by adding a package to
|
||||
<literal>systemd.packages</literal>. See the fix proposed in
|
||||
<link xlink:href="https://github.com/NixOS/nixpkgs/issues/135557#issuecomment-1295392470">NixOS’s
|
||||
systemd abstraction doesn’t work with systemd template
|
||||
units</link> for an example.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>polymc</literal> package has been removed due to
|
||||
a rogue maintainer. It has been replaced by
|
||||
<literal>prismlauncher</literal>, a fork by the rest of the
|
||||
maintainers. For more details, see
|
||||
<link xlink:href="https://github.com/NixOS/nixpkgs/pull/196624">the
|
||||
pull request that made this change</link> and
|
||||
<link xlink:href="https://github.com/NixOS/nixpkgs/issues/196460">this
|
||||
issue detailing the vulnerability</link>. Users with existing
|
||||
installations should rename
|
||||
<literal>~/.local/share/polymc</literal> to
|
||||
<literal>~/.local/share/PrismLauncher</literal>. The main
|
||||
config file’s path has also moved from
|
||||
<literal>~/.local/share/polymc/polymc.cfg</literal> to
|
||||
<literal>~/.local/share/PrismLauncher/prismlauncher.cfg</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>bloat</literal> package has been updated from
|
||||
unstable-2022-03-31 to unstable-2022-10-25, which brings a
|
||||
breaking change. See
|
||||
<link xlink:href="https://git.freesoftwareextremist.com/bloat/commit/?id=887ed241d64ba5db3fd3d87194fb5595e5ad7d73">this
|
||||
upstream commit message</link> for details.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>services.matrix-synapse</literal> systemd unit
|
||||
has been hardened.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>services.grafana</literal> options were converted
|
||||
to a
|
||||
<link xlink:href="https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md">RFC
|
||||
0042</link> configuration.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>services.grafana.provision.datasources</literal>
|
||||
and <literal>services.grafana.provision.dashboards</literal>
|
||||
options were converted to a
|
||||
<link xlink:href="https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md">RFC
|
||||
0042</link> configuration. They also now support specifying
|
||||
the provisioning YAML file with <literal>path</literal>
|
||||
option.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>services.grafana.provision.alerting</literal>
|
||||
option was added. It includes suboptions for every
|
||||
alerting-related objects (with the exception of
|
||||
<literal>notifiers</literal>), which means it’s now possible
|
||||
to configure modern Grafana alerting declaratively.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Matrix Synapse now requires entries in the
|
||||
@@ -737,6 +1179,14 @@
|
||||
release notes</link> for more details.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>guake</literal> package has been updated from
|
||||
3.6.3 to 3.9.0, see the
|
||||
<link xlink:href="https://github.com/Guake/guake/releases">changelog</link>
|
||||
for more details.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>dockerTools.buildImage</literal> deprecates the
|
||||
@@ -772,6 +1222,13 @@
|
||||
will be removed once the transition to CommonMark is complete.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The redis module now persists each instance’s configuration
|
||||
file in the state directory, in order to support some more
|
||||
advanced use cases like sentinel.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The udisks2 service, available at
|
||||
@@ -784,11 +1241,66 @@
|
||||
re-enabled it.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Nextcloud has been updated to version
|
||||
<emphasis role="strong">25</emphasis>. Additionally the
|
||||
following things have changed for Nextcloud in NixOS:
|
||||
</para>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
For Nextcloud <emphasis role="strong">>=24</emphasis>,
|
||||
the default PHP version is 8.1.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Nextcloud <emphasis role="strong">23</emphasis> has been
|
||||
removed since it will reach its
|
||||
<link xlink:href="https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule/d76576a12a626d53305d480a6065b57cab705d3d">end
|
||||
of life in December 2022</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
For <literal>system.stateVersion</literal> being
|
||||
<emphasis role="strong">>=22.11</emphasis>, Nextcloud
|
||||
25 will be installed by default. For older versions,
|
||||
Nextcloud 24 will be installed.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Please ensure that you only upgrade on major release at a
|
||||
time! Nextcloud doesn’t support upgrades across multiple
|
||||
versions, i.e. an upgrade from
|
||||
<emphasis role="strong">23</emphasis> to
|
||||
<emphasis role="strong">25</emphasis> is only possible
|
||||
when upgrading to <emphasis role="strong">24</emphasis>
|
||||
first.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Add udev rules for the Teensy family of microcontrollers.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The Qt QML disk cache is now disabled by default. This fixes a
|
||||
long-standing issue where updating Qt/KDE apps would sometimes
|
||||
cause them to crash or behave strangely without explanation.
|
||||
Those concerned about the small (~10%) performance hit to
|
||||
application startup can re-enable the cache (and expose
|
||||
themselves to gremlins) by setting the envrionment variable
|
||||
<literal>QML_FORCE_DISK_CACHE</literal> to
|
||||
<literal>1</literal> using e.g. the
|
||||
<literal>environment.sessionVariables</literal> NixOS option.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
systemd-oomd is enabled by default. Depending on which systemd
|
||||
@@ -804,6 +1316,13 @@
|
||||
<link xlink:href="options.html#opt-systemd.oomd.enableUserServices">systemd.oomd.enableUserServices</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>tt-rss</literal> service performs two database
|
||||
migrations when you first use its web UI after upgrade.
|
||||
Consider backing up its database before updating.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>pass-secret-service</literal> package now
|
||||
@@ -826,6 +1345,29 @@
|
||||
<literal>services.wordpress.sites.<site>.languages</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The default package for
|
||||
<literal>services.mullvad-vpn.package</literal> was changed to
|
||||
<literal>pkgs.mullvad</literal>, allowing cross-platform usage
|
||||
of Mullvad. <literal>pkgs.mullvad</literal> only contains the
|
||||
Mullvad CLI tool, so users who rely on the Mullvad GUI will
|
||||
want to change it back to <literal>pkgs.mullvad-vpn</literal>,
|
||||
or add <literal>pkgs.mullvad-vpn</literal> to their
|
||||
environment.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
PowerDNS has been updated from <literal>4.6.x</literal> to
|
||||
<literal>4.7.x</literal>. Please be sure to review the
|
||||
<link xlink:href="https://doc.powerdns.com/authoritative/upgrading.html#to-4-7-0-or-master">Upgrade
|
||||
Notes</link> provided by upstream before upgrading. Worth
|
||||
specifically noting is that the new Catalog Zones feature
|
||||
comes with a mandatory schema change for the gsql database
|
||||
backends, which has to be manually applied.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
There is a new module for the <literal>thunar</literal>
|
||||
@@ -863,6 +1405,34 @@
|
||||
the npm install step prunes dev dependencies.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>boot.kernel.sysctl</literal> is defined as a
|
||||
freeformType and adds a custom merge option for
|
||||
<quote>net.core.rmem_max</quote> (taking the highest value
|
||||
defined to avoid conflicts between 2 services trying to set
|
||||
that value).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>mame</literal> package does not ship with its
|
||||
tools anymore in the default output. They were moved to a
|
||||
separate <literal>tools</literal> output instead. For
|
||||
convenience, <literal>mame-tools</literal> package was added
|
||||
for those who want to use it.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
A NixOS module for Firefox has been added which allows
|
||||
preferences and
|
||||
<link xlink:href="https://github.com/mozilla/policy-templates/blob/master/README.md">policies</link>
|
||||
to be set. This also allows extensions to be installed via the
|
||||
<literal>ExtensionSettings</literal> policy. The new options
|
||||
are under <literal>programs.firefox</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -1,31 +1,72 @@
|
||||
# Booting from a USB Drive {#sec-booting-from-usb}
|
||||
# Booting from a USB flash drive {#sec-booting-from-usb}
|
||||
|
||||
For systems without CD drive, the NixOS live CD can be booted from a USB
|
||||
stick. You can use the `dd` utility to write the image:
|
||||
`dd if=path-to-image of=/dev/sdX`. Be careful about specifying the correct
|
||||
drive; you can use the `lsblk` command to get a list of block devices.
|
||||
The image has to be written verbatim to the USB flash drive for it to be
|
||||
bootable on UEFI and BIOS systems. Here are the recommended tools to do that.
|
||||
|
||||
::: {.note}
|
||||
::: {.title}
|
||||
On macOS
|
||||
## Creating bootable USB flash drive with a graphical tool {#sec-booting-from-usb-graphical}
|
||||
|
||||
Etcher is a popular and user-friendly tool. It works on Linux, Windows and macOS.
|
||||
|
||||
Download it from [balena.io](https://www.balena.io/etcher/), start the program,
|
||||
select the downloaded NixOS ISO, then select the USB flash drive and flash it.
|
||||
|
||||
::: {.warning}
|
||||
Etcher reports errors and usage statistics by default, which can be disabled in
|
||||
the settings.
|
||||
:::
|
||||
|
||||
```ShellSession
|
||||
$ diskutil list
|
||||
[..]
|
||||
/dev/diskN (external, physical):
|
||||
#: TYPE NAME SIZE IDENTIFIER
|
||||
[..]
|
||||
$ diskutil unmountDisk diskN
|
||||
Unmount of all volumes on diskN was successful
|
||||
$ sudo dd if=nix.iso of=/dev/rdiskN bs=1M
|
||||
```
|
||||
An alternative is [USBImager](https://bztsrc.gitlab.io/usbimager),
|
||||
which is very simple and does not connect to the internet. Download the version
|
||||
with write-only (wo) interface for your system. Start the program,
|
||||
select the image, select the USB flash drive and click "Write".
|
||||
|
||||
Using the \'raw\' `rdiskN` device instead of `diskN` completes in
|
||||
minutes instead of hours. After `dd` completes, a GUI dialog \"The disk
|
||||
you inserted was not readable by this computer\" will pop up, which can
|
||||
be ignored.
|
||||
:::
|
||||
## Creating bootable USB flash drive from a Terminal on Linux {#sec-booting-from-usb-linux}
|
||||
|
||||
The `dd` utility will write the image verbatim to the drive, making it
|
||||
the recommended option for both UEFI and non-UEFI installations.
|
||||
1. Plug in the USB flash drive.
|
||||
2. Find the corresponding device with `lsblk`. You can distinguish them by
|
||||
their size.
|
||||
3. Make sure all partitions on the device are properly unmounted. Replace `sdX`
|
||||
with your device (e.g. `sdb`).
|
||||
|
||||
```ShellSession
|
||||
sudo umount /dev/sdX*
|
||||
```
|
||||
|
||||
4. Then use the `dd` utility to write the image to the USB flash drive.
|
||||
|
||||
```ShellSession
|
||||
sudo dd if=<path-to-image> of=/dev/sdX bs=4M conv=fsync
|
||||
```
|
||||
|
||||
## Creating bootable USB flash drive from a Terminal on macOS {#sec-booting-from-usb-macos}
|
||||
|
||||
1. Plug in the USB flash drive.
|
||||
2. Find the corresponding device with `diskutil list`. You can distinguish them
|
||||
by their size.
|
||||
3. Make sure all partitions on the device are properly unmounted. Replace `diskX`
|
||||
with your device (e.g. `disk1`).
|
||||
|
||||
```ShellSession
|
||||
diskutil unmountDisk diskX
|
||||
```
|
||||
|
||||
4. Then use the `dd` utility to write the image to the USB flash drive.
|
||||
|
||||
```ShellSession
|
||||
sudo dd if=<path-to-image> of=/dev/rdiskX bs=4m
|
||||
```
|
||||
|
||||
After `dd` completes, a GUI dialog \"The disk
|
||||
you inserted was not readable by this computer\" will pop up, which can
|
||||
be ignored.
|
||||
|
||||
::: {.note}
|
||||
Using the \'raw\' `rdiskX` device instead of `diskX` with dd completes in
|
||||
minutes instead of hours.
|
||||
:::
|
||||
|
||||
5. Eject the disk when it is finished.
|
||||
|
||||
```ShellSession
|
||||
diskutil eject /dev/diskX
|
||||
```
|
||||
|
||||
@@ -1,30 +1,143 @@
|
||||
# Installing NixOS {#sec-installation}
|
||||
|
||||
## Booting the system {#sec-installation-booting}
|
||||
## Booting from the install medium {#sec-installation-booting}
|
||||
|
||||
To begin the installation, you have to boot your computer from the install drive.
|
||||
|
||||
1. Plug in the install drive. Then turn on or restart your computer.
|
||||
|
||||
2. Open the boot menu by pressing the appropriate key, which is usually shown
|
||||
on the display on early boot.
|
||||
Select the USB flash drive (the option usually contains the word "USB").
|
||||
If you choose the incorrect drive, your computer will likely continue to
|
||||
boot as normal. In that case restart your computer and pick a
|
||||
different drive.
|
||||
|
||||
::: {.note}
|
||||
The key to open the boot menu is different across computer brands and even
|
||||
models. It can be <kbd>F12</kbd>, but also <kbd>F1</kbd>,
|
||||
<kbd>F9</kbd>, <kbd>F10</kbd>, <kbd>Enter</kbd>, <kbd>Del</kbd>,
|
||||
<kbd>Esc</kbd> or another function key. If you are unsure and don't see
|
||||
it on the early boot screen, you can search online for your computers
|
||||
brand, model followed by "boot from usb".
|
||||
The computer might not even have that feature, so you have to go into the
|
||||
BIOS/UEFI settings to change the boot order. Again, search online for
|
||||
details about your specific computer model.
|
||||
|
||||
For Apple computers with Intel processors press and hold the <kbd>⌥</kbd>
|
||||
(Option or Alt) key until you see the boot menu. On Apple silicon press
|
||||
and hold the power button.
|
||||
:::
|
||||
|
||||
::: {.note}
|
||||
If your computer supports both BIOS and UEFI boot, choose the UEFI option.
|
||||
:::
|
||||
|
||||
::: {.note}
|
||||
If you use a CD for the installation, the computer will probably boot from
|
||||
it automatically. If not, choose the option containing the word "CD" from
|
||||
the boot menu.
|
||||
:::
|
||||
|
||||
3. Shortly after selecting the appropriate boot drive, you should be
|
||||
presented with a menu with different installer options. Leave the default
|
||||
and wait (or press <kbd>Enter</kbd> to speed up).
|
||||
|
||||
4. The graphical images will start their corresponding desktop environment
|
||||
and the graphical installer, which can take some time. The minimal images
|
||||
will boot to a command line. You have to follow the instructions in
|
||||
[](#sec-installation-manual) there.
|
||||
|
||||
## Graphical Installation {#sec-installation-graphical}
|
||||
|
||||
The graphical installer is recommended for desktop users and will guide you
|
||||
through the installation.
|
||||
|
||||
1. In the "Welcome" screen, you can select the language of the Installer and
|
||||
the installed system.
|
||||
|
||||
::: {.tip}
|
||||
Leaving the language as "American English" will make it easier to search for
|
||||
error messages in a search engine or to report an issue.
|
||||
:::
|
||||
|
||||
2. Next you should choose your location to have the timezone set correctly.
|
||||
You can actually click on the map!
|
||||
|
||||
::: {.note}
|
||||
The installer will use an online service to guess your location based on
|
||||
your public IP address.
|
||||
:::
|
||||
|
||||
3. Then you can select the keyboard layout. The default keyboard model should
|
||||
work well with most desktop keyboards. If you have a special keyboard or
|
||||
notebook, your model might be in the list. Select the language you are most
|
||||
comfortable typing in.
|
||||
|
||||
4. On the "Users" screen, you have to type in your display name, login name
|
||||
and password. You can also enable an option to automatically login to the
|
||||
desktop.
|
||||
|
||||
5. Then you have the option to choose a desktop environment. If you want to
|
||||
create a custom setup with a window manager, you can select "No desktop".
|
||||
|
||||
::: {.tip}
|
||||
If you don't have a favorite desktop and don't know which one to choose,
|
||||
you can stick to either GNOME or Plasma. They have a quite different
|
||||
design, so you should choose whichever you like better.
|
||||
They are both popular choices and well tested on NixOS.
|
||||
:::
|
||||
|
||||
6. You have the option to allow unfree software in the next screen.
|
||||
|
||||
7. The easiest option in the "Partitioning" screen is "Erase disk", which will
|
||||
delete all data from the selected disk and install the system on it.
|
||||
Also select "Swap (with Hibernation)" in the dropdown below it.
|
||||
You have the option to encrypt the whole disk with LUKS.
|
||||
|
||||
::: {.note}
|
||||
At the top left you see if the Installer was booted with BIOS or UEFI. If
|
||||
you know your system supports UEFI and it shows "BIOS", reboot with the
|
||||
correct option.
|
||||
:::
|
||||
|
||||
::: {.warning}
|
||||
Make sure you have selected the correct disk at the top and that no
|
||||
valuable data is still on the disk! It will be deleted when
|
||||
formatting the disk.
|
||||
:::
|
||||
|
||||
8. Check the choices you made in the "Summary" and click "Install".
|
||||
|
||||
::: {.note}
|
||||
The installation takes about 15 minutes. The time varies based on the
|
||||
selected desktop environment, internet connection speed and disk write speed.
|
||||
:::
|
||||
|
||||
9. When the install is complete, remove the USB flash drive and
|
||||
reboot into your new system!
|
||||
|
||||
## Manual Installation {#sec-installation-manual}
|
||||
|
||||
NixOS can be installed on BIOS or UEFI systems. The procedure for a UEFI
|
||||
installation is by and large the same as a BIOS installation. The
|
||||
differences are mentioned in the steps that follow.
|
||||
installation is broadly the same as for a BIOS installation. The differences
|
||||
are mentioned in the following steps.
|
||||
|
||||
The installation media can be burned to a CD, or now more commonly,
|
||||
"burned" to a USB drive (see [](#sec-booting-from-usb)).
|
||||
The NixOS manual is available by running `nixos-help` in the command line
|
||||
or from the application menu in the desktop environment.
|
||||
|
||||
The installation media contains a basic NixOS installation. When it's
|
||||
finished booting, it should have detected most of your hardware.
|
||||
|
||||
The NixOS manual is available by running `nixos-help`.
|
||||
To have access to the command line on the graphical images, open
|
||||
Terminal (GNOME) or Konsole (Plasma) from the application menu.
|
||||
|
||||
You are logged-in automatically as `nixos`. The `nixos` user account has
|
||||
an empty password so you can use `sudo` without a password:
|
||||
|
||||
```ShellSession
|
||||
$ sudo -i
|
||||
```
|
||||
|
||||
If you downloaded the graphical ISO image, you can run `systemctl
|
||||
start display-manager` to start the desktop environment. If you want
|
||||
to continue on the terminal, you can use `loadkeys` to switch to your
|
||||
preferred keyboard layout. (We even provide neo2 via `loadkeys de
|
||||
neo`!)
|
||||
You can use `loadkeys` to switch to your preferred keyboard layout.
|
||||
(We even provide neo2 via `loadkeys de neo`!)
|
||||
|
||||
If the text is too small to be legible, try `setfont ter-v32n` to
|
||||
increase the font size.
|
||||
@@ -33,7 +146,8 @@ To install over a serial port connect with `115200n8` (e.g.
|
||||
`picocom -b 115200 /dev/ttyUSB0`). When the bootloader lists boot
|
||||
entries, select the serial console boot entry.
|
||||
|
||||
### Networking in the installer {#sec-installation-booting-networking}
|
||||
### Networking in the installer {#sec-installation-manual-networking}
|
||||
[]{#sec-installation-booting-networking} <!-- legacy anchor -->
|
||||
|
||||
The boot process should have brought up networking (check `ip
|
||||
a`). Networking is necessary for the installer, since it will
|
||||
@@ -100,7 +214,8 @@ placed by mounting the image on a different machine). Alternatively you
|
||||
must set a password for either `root` or `nixos` with `passwd` to be
|
||||
able to login.
|
||||
|
||||
## Partitioning and formatting {#sec-installation-partitioning}
|
||||
### Partitioning and formatting {#sec-installation-manual-partitioning}
|
||||
[]{#sec-installation-partitioning} <!-- legacy anchor -->
|
||||
|
||||
The NixOS installer doesn't do any partitioning or formatting, so you
|
||||
need to do that yourself.
|
||||
@@ -112,7 +227,8 @@ below use `parted`, but also provides `fdisk`, `gdisk`, `cfdisk`, and
|
||||
The recommended partition scheme differs depending if the computer uses
|
||||
*Legacy Boot* or *UEFI*.
|
||||
|
||||
### UEFI (GPT) {#sec-installation-partitioning-UEFI}
|
||||
#### UEFI (GPT) {#sec-installation-manual-partitioning-UEFI}
|
||||
[]{#sec-installation-partitioning-UEFI} <!-- legacy anchor -->
|
||||
|
||||
Here\'s an example partition scheme for UEFI, using `/dev/sda` as the
|
||||
device.
|
||||
@@ -158,9 +274,10 @@ update /etc/fstab.
|
||||
```
|
||||
|
||||
Once complete, you can follow with
|
||||
[](#sec-installation-partitioning-formatting).
|
||||
[](#sec-installation-manual-partitioning-formatting).
|
||||
|
||||
### Legacy Boot (MBR) {#sec-installation-partitioning-MBR}
|
||||
#### Legacy Boot (MBR) {#sec-installation-manual-partitioning-MBR}
|
||||
[]{#sec-installation-partitioning-MBR} <!-- legacy anchor -->
|
||||
|
||||
Here\'s an example partition scheme for Legacy Boot, using `/dev/sda` as
|
||||
the device.
|
||||
@@ -202,9 +319,10 @@ update /etc/fstab.
|
||||
:::
|
||||
|
||||
Once complete, you can follow with
|
||||
[](#sec-installation-partitioning-formatting).
|
||||
[](#sec-installation-manual-partitioning-formatting).
|
||||
|
||||
### Formatting {#sec-installation-partitioning-formatting}
|
||||
#### Formatting {#sec-installation-manual-partitioning-formatting}
|
||||
[]{#sec-installation-partitioning-formatting} <!-- legacy anchor -->
|
||||
|
||||
Use the following commands:
|
||||
|
||||
@@ -239,7 +357,8 @@ Use the following commands:
|
||||
|
||||
- For creating software RAID devices, use `mdadm`.
|
||||
|
||||
## Installing {#sec-installation-installing}
|
||||
### Installing {#sec-installation-manual-installing}
|
||||
[]{#sec-installation-installing} <!-- legacy anchor -->
|
||||
|
||||
1. Mount the target file system on which NixOS should be installed on
|
||||
`/mnt`, e.g.
|
||||
@@ -410,7 +529,8 @@ Use the following commands:
|
||||
You may also want to install some software. This will be covered in
|
||||
[](#sec-package-management).
|
||||
|
||||
## Installation summary {#sec-installation-summary}
|
||||
### Installation summary {#sec-installation-manual-summary}
|
||||
[]{#sec-installation-summary} <!-- legacy anchor -->
|
||||
|
||||
To summarise, [Example: Commands for Installing NixOS on `/dev/sda`](#ex-install-sequence)
|
||||
shows a typical sequence of commands for installing NixOS on an empty hard
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
# Obtaining NixOS {#sec-obtaining}
|
||||
|
||||
NixOS ISO images can be downloaded from the [NixOS download
|
||||
page](https://nixos.org/nixos/download.html). There are a number of
|
||||
installation options. If you happen to have an optical drive and a spare
|
||||
CD, burning the image to CD and booting from that is probably the
|
||||
easiest option. Most people will need to prepare a USB stick to boot
|
||||
from. [](#sec-booting-from-usb) describes the preferred method to
|
||||
prepare a USB stick. A number of alternative methods are presented in
|
||||
the [NixOS Wiki](https://nixos.wiki/wiki/NixOS_Installation_Guide#Making_the_installation_media).
|
||||
page](https://nixos.org/download.html#nixos-iso). Follow the instructions in
|
||||
[](#sec-booting-from-usb) to create a bootable USB flash drive.
|
||||
|
||||
If you have a very old system that can't boot from USB, you can burn the image
|
||||
to an empty CD. NixOS might not work very well on such systems.
|
||||
|
||||
As an alternative to installing NixOS yourself, you can get a running
|
||||
NixOS system through several other means:
|
||||
|
||||
- Using virtual appliances in Open Virtualization Format (OVF) that
|
||||
can be imported into VirtualBox. These are available from the [NixOS
|
||||
download page](https://nixos.org/nixos/download.html).
|
||||
download page](https://nixos.org/download.html#nixos-virtualbox).
|
||||
|
||||
- Using AMIs for Amazon's EC2. To find one for your region and
|
||||
instance type, please refer to the [list of most recent
|
||||
AMIs](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/ec2-amis.nix).
|
||||
- Using AMIs for Amazon's EC2. To find one for your region, please refer
|
||||
to the [download page](https://nixos.org/download.html#nixos-amazon).
|
||||
|
||||
- Using NixOps, the NixOS-based cloud deployment tool, which allows
|
||||
you to provision VirtualBox and EC2 NixOS instances from declarative
|
||||
|
||||
@@ -19,6 +19,7 @@ pandoc_flags=(
|
||||
"--lua-filter=$DIR/../../../doc/build-aux/pandoc-filters/myst-reader/roles.lua"
|
||||
"--lua-filter=$DIR/../../../doc/build-aux/pandoc-filters/link-unix-man-references.lua"
|
||||
"--lua-filter=$DIR/../../../doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua"
|
||||
"--lua-filter=$DIR/../../../doc/build-aux/pandoc-filters/docbook-writer/html-elements.lua"
|
||||
"--lua-filter=$DIR/../../../doc/build-aux/pandoc-filters/docbook-writer/labelless-link-is-xref.lua"
|
||||
-f "commonmark${pandoc_commonmark_enabled_extensions}+smart"
|
||||
-t docbook
|
||||
|
||||
@@ -576,4 +576,4 @@ In addition to numerous new and upgraded packages, this release has the followin
|
||||
|
||||
- More jdk and jre versions are now exposed via `java-packages.compiler`.
|
||||
|
||||
- The sets `haskell.packages` and `haskell.compiler` now contain for every ghc version an attribute with the minor version dropped. E.g. for `ghc8107` there also now exists `ghc810`. Those attributes point to the same compilers and packagesets but have the advantage that e.g. `ghc92` stays stable when we update from `ghc924` to `ghc925`.
|
||||
- The sets `haskell.packages` and `haskell.compiler` now contain for every ghc version an attribute with the minor version dropped. E.g. for `ghc8107` there also now exists `ghc810`. Those attributes point to the same compilers and packagesets but have the advantage that e.g. `ghc92` stays stable when we update from `ghc925` to `ghc926`.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user