Merge branch 'NixOS:master' into swww
This commit is contained in:
@@ -26,6 +26,7 @@ If applicable, add screenshots to help explain your problem.
|
||||
Add any other context about the problem here.
|
||||
|
||||
### Notify maintainers
|
||||
|
||||
<!--
|
||||
Please @ people who are in the `meta.maintainers` list of the offending package or module.
|
||||
If in doubt, check `git blame` for whoever last touched something.
|
||||
|
||||
@@ -1,31 +1,36 @@
|
||||
---
|
||||
name: Build failure
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
title: 'Build failure: PACKAGENAME'
|
||||
labels: '0.kind: build failure'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
### Steps To Reproduce
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
1. build *X*
|
||||
|
||||
### Build log
|
||||
|
||||
```
|
||||
log here if short otherwise a link to a gist
|
||||
```
|
||||
|
||||
### Additional context
|
||||
|
||||
Add any other context about the problem here.
|
||||
|
||||
### Notify maintainers
|
||||
|
||||
<!--
|
||||
Please @ people who are in the `meta.maintainers` list of the offending package or module.
|
||||
If in doubt, check `git blame` for whoever last touched something.
|
||||
-->
|
||||
|
||||
### Metadata
|
||||
|
||||
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.
|
||||
|
||||
```console
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: Missing or incorrect documentation
|
||||
about: Help us improve the Nixpkgs and NixOS reference manuals
|
||||
title: ''
|
||||
title: 'Documentation: '
|
||||
labels: '9.needs: documentation'
|
||||
assignees: ''
|
||||
|
||||
@@ -11,6 +11,10 @@ assignees: ''
|
||||
|
||||
<!-- describe your problem -->
|
||||
|
||||
## Proposal
|
||||
|
||||
<!-- propose a solution (optional) -->
|
||||
|
||||
## Checklist
|
||||
|
||||
<!-- make sure this issue is not redundant or obsolete -->
|
||||
@@ -26,7 +30,3 @@ assignees: ''
|
||||
[open documentation issues]: https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+is%3Aopen+label%3A%229.needs%3A+documentation%22
|
||||
[open documentation pull requests]: https://github.com/NixOS/nixpkgs/pulls?q=is%3Aopen+is%3Apr+label%3A%228.has%3A+documentation%22%2C%226.topic%3A+documentation%22
|
||||
|
||||
## Proposal
|
||||
|
||||
<!-- propose a solution -->
|
||||
|
||||
|
||||
@@ -1,24 +1,17 @@
|
||||
---
|
||||
name: Out-of-date package reports
|
||||
about: For packages that are out-of-date
|
||||
title: ''
|
||||
title: 'Update request: PACKAGENAME OLDVERSION → NEWVERSION'
|
||||
labels: '9.needs: package (update)'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
###### Checklist
|
||||
|
||||
<!-- Note that these are hard requirements -->
|
||||
|
||||
<!--
|
||||
You can use the "Go to file" functionality on GitHub to find the package
|
||||
Then you can go to the history for this package
|
||||
Find the latest "package_name: old_version -> new_version" commit
|
||||
The "new_version" is the current version of the package
|
||||
-->
|
||||
- [ ] Checked the [nixpkgs master branch](https://github.com/NixOS/nixpkgs)
|
||||
- Package name:
|
||||
- Latest released version:
|
||||
<!-- Search your package here: https://search.nixos.org/packages?channel=unstable -->
|
||||
- Current version on the unstable channel:
|
||||
- Current version on the stable/release channel:
|
||||
<!--
|
||||
Type the name of your package and try to find an open pull request for the package
|
||||
If you find an open pull request, you can review it!
|
||||
@@ -26,23 +19,10 @@ There's a high chance that you'll have the new version right away while helping
|
||||
-->
|
||||
- [ ] Checked the [nixpkgs pull requests](https://github.com/NixOS/nixpkgs/pulls)
|
||||
|
||||
###### Project name
|
||||
`nix search` name:
|
||||
<!--
|
||||
The current version can be found easily with the same process as above for checking the master branch
|
||||
If an open PR is present for the package, take this version as the current one and link to the PR
|
||||
-->
|
||||
current version:
|
||||
desired version:
|
||||
**Notify maintainers**
|
||||
|
||||
###### Notify maintainers
|
||||
<!--
|
||||
Search your package here: https://search.nixos.org/packages?channel=unstable
|
||||
If no maintainer is listed for your package, tag the person that last updated the package
|
||||
-->
|
||||
<!-- If the search.nixos.org result shows no maintainers, tag the person that last updated the package. -->
|
||||
|
||||
maintainers:
|
||||
-----
|
||||
|
||||
###### Note for maintainers
|
||||
|
||||
Please tag this issue in your PR.
|
||||
Note for maintainers: Please tag this issue in your PR.
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
name: Packaging requests
|
||||
about: For packages that are missing
|
||||
title: ''
|
||||
title: 'Package request: PACKAGENAME'
|
||||
labels: '0.kind: packaging request'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Project description**
|
||||
_describe the project a little_
|
||||
|
||||
<!-- Describe the project a little: -->
|
||||
|
||||
**Metadata**
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ For new packages please briefly describe the package or provide a link to its ho
|
||||
- [ ] (Package updates) Added a release notes entry if the change is major or breaking
|
||||
- [ ] (Module updates) Added a release notes entry if the change is significant
|
||||
- [ ] (Module addition) Added a release notes entry if adding a new NixOS module
|
||||
- [ ] (Release notes changes) Ran `nixos/doc/manual/md-to-db.sh` to update generated release notes
|
||||
- [ ] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||
|
||||
<!--
|
||||
|
||||
@@ -19,7 +19,7 @@ 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@v18
|
||||
- uses: cachix/install-nix-action@v19
|
||||
- uses: cachix/cachix-action@v12
|
||||
with:
|
||||
# This cache is for the nixpkgs repo checks and should not be trusted or used elsewhere.
|
||||
|
||||
@@ -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@v18
|
||||
- uses: cachix/install-nix-action@v19
|
||||
with:
|
||||
# nixpkgs commit is pinned so that it doesn't break
|
||||
# editorconfig-checker 2.4.0
|
||||
|
||||
@@ -18,7 +18,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@v18
|
||||
- uses: cachix/install-nix-action@v19
|
||||
with:
|
||||
# explicitly enable sandbox
|
||||
extra_nix_config: sandbox = true
|
||||
|
||||
@@ -18,7 +18,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@v18
|
||||
- uses: cachix/install-nix-action@v19
|
||||
with:
|
||||
# explicitly enable sandbox
|
||||
extra_nix_config: sandbox = true
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v18
|
||||
- uses: cachix/install-nix-action@v19
|
||||
with:
|
||||
# explicitly enable sandbox
|
||||
extra_nix_config: sandbox = true
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
name: NixOS manual checks
|
||||
|
||||
permissions: read-all
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
branches-ignore:
|
||||
- 'release-**'
|
||||
paths:
|
||||
- 'nixos/**/*.xml'
|
||||
- 'nixos/**/*.md'
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'NixOS'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
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@v18
|
||||
- name: Check DocBook files generated from Markdown are consistent
|
||||
run: |
|
||||
nixos/doc/manual/md-to-db.sh
|
||||
git diff --exit-code || {
|
||||
echo
|
||||
echo 'Generated manual files are out of date.'
|
||||
echo 'Please run'
|
||||
echo
|
||||
echo ' nixos/doc/manual/md-to-db.sh'
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v18
|
||||
- uses: cachix/install-nix-action@v19
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixpkgs-unstable
|
||||
- name: setup
|
||||
|
||||
+6
-3
@@ -128,14 +128,17 @@ Anything that does not cause user or downstream dependency regressions can be ba
|
||||
- Security critical applications (E.g. `firefox`)
|
||||
|
||||
## Generating 23.05 Release Notes
|
||||
<!--
|
||||
note: title unchanged even though we don't need regeneration because extant
|
||||
PRs will link here. definitely change the title for 23.11 though.
|
||||
-->
|
||||
|
||||
Documentation in nixpkgs is transitioning to a markdown-centric workflow. Release notes now require a translation step to convert from markdown to a compatible docbook document.
|
||||
Documentation in nixpkgs is transitioning to a markdown-centric workflow. In the past release notes required a translation step to convert from markdown to a compatible docbook document, but this is no longer necessary.
|
||||
|
||||
Steps for updating 23.05 Release notes:
|
||||
|
||||
1. Edit `nixos/doc/manual/release-notes/rl-2305.section.md` with the desired changes
|
||||
2. Run `./nixos/doc/manual/md-to-db.sh` to render `nixos/doc/manual/from_md/release-notes/rl-2305.section.xml`
|
||||
3. Include changes to `rl-2305.section.md` and `rl-2305.section.xml` in the same commit.
|
||||
2. Commit changes to `rl-2305.section.md`.
|
||||
|
||||
## Reviewing contributions
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ MD_TARGETS=$(addsuffix .xml, $(basename $(shell find . -type f -regex '.*\.md$$'
|
||||
PANDOC ?= pandoc
|
||||
|
||||
pandoc_media_dir = media
|
||||
# NOTE: Keep in sync with NixOS manual (/nixos/doc/manual/md-to-db.sh) and conversion script (/maintainers/scripts/db-to-md.sh).
|
||||
# NOTE: Keep in sync with conversion script (/maintainers/scripts/db-to-md.sh).
|
||||
# TODO: Remove raw-attribute when we can get rid of DocBook altogether.
|
||||
pandoc_commonmark_enabled_extensions = +attributes+fenced_divs+footnotes+bracketed_spans+definition_lists+pipe_tables+raw_attribute
|
||||
# Not needed:
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--[[
|
||||
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
|
||||
@@ -163,3 +163,30 @@ or "hg"), `domain` and `fetchSubmodules`.
|
||||
If `fetchSubmodules` is `true`, `fetchFromSourcehut` uses `fetchgit`
|
||||
or `fetchhg` with `fetchSubmodules` or `fetchSubrepos` set to `true`,
|
||||
respectively. Otherwise, the fetcher uses `fetchzip`.
|
||||
|
||||
## `requireFile` {#requirefile}
|
||||
|
||||
`requireFile` allows requesting files that cannot be fetched automatically, but whose content is known.
|
||||
This is a useful last-resort workaround for license restrictions that prohibit redistribution, or for downloads that are only accessible after authenticating interactively in a browser.
|
||||
If the requested file is present in the Nix store, the resulting derivation will not be built, because its expected output is already available.
|
||||
Otherwise, the builder will run, but fail with a message explaining to the user how to provide the file. The following code, for example:
|
||||
|
||||
```
|
||||
requireFile {
|
||||
name = "jdk-${version}_linux-x64_bin.tar.gz";
|
||||
url = "https://www.oracle.com/java/technologies/javase-jdk11-downloads.html";
|
||||
sha256 = "94bd34f85ee38d3ef59e5289ec7450b9443b924c55625661fffe66b03f2c8de2";
|
||||
}
|
||||
```
|
||||
results in this error message:
|
||||
```
|
||||
***
|
||||
Unfortunately, we cannot download file jdk-11.0.10_linux-x64_bin.tar.gz automatically.
|
||||
Please go to https://www.oracle.com/java/technologies/javase-jdk11-downloads.html to download it yourself, and add it to the Nix store
|
||||
using either
|
||||
nix-store --add-fixed sha256 jdk-11.0.10_linux-x64_bin.tar.gz
|
||||
or
|
||||
nix-prefetch-url --type sha256 file:///path/to/jdk-11.0.10_linux-x64_bin.tar.gz
|
||||
|
||||
***
|
||||
```
|
||||
|
||||
@@ -11,4 +11,5 @@
|
||||
<xi:include href="images/snaptools.section.xml" />
|
||||
<xi:include href="images/portableservice.section.xml" />
|
||||
<xi:include href="images/makediskimage.section.xml" />
|
||||
<xi:include href="images/binarycache.section.xml" />
|
||||
</chapter>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# pkgs.mkBinaryCache {#sec-pkgs-binary-cache}
|
||||
|
||||
`pkgs.mkBinaryCache` is a function for creating Nix flat-file binary caches. Such a cache exists as a directory on disk, and can be used as a Nix substituter by passing `--substituter file:///path/to/cache` to Nix commands.
|
||||
|
||||
Nix packages are most commonly shared between machines using [HTTP, SSH, or S3](https://nixos.org/manual/nix/stable/package-management/sharing-packages.html), but a flat-file binary cache can still be useful in some situations. For example, you can copy it directly to another machine, or make it available on a network file system. It can also be a convenient way to make some Nix packages available inside a container via bind-mounting.
|
||||
|
||||
Note that this function is meant for advanced use-cases. The more idiomatic way to work with flat-file binary caches is via the [nix-copy-closure](https://nixos.org/manual/nix/stable/command-ref/nix-copy-closure.html) command. You may also want to consider [dockerTools](#sec-pkgs-dockerTools) for your containerization needs.
|
||||
|
||||
## Example
|
||||
|
||||
The following derivation will construct a flat-file binary cache containing the closure of `hello`.
|
||||
|
||||
```nix
|
||||
mkBinaryCache {
|
||||
rootPaths = [hello];
|
||||
}
|
||||
```
|
||||
|
||||
- `rootPaths` specifies a list of root derivations. The transitive closure of these derivations' outputs will be copied into the cache.
|
||||
|
||||
Here's an example of building and using the cache.
|
||||
|
||||
Build the cache on one machine, `host1`:
|
||||
|
||||
```shellSession
|
||||
nix-build -E 'with import <nixpkgs> {}; mkBinaryCache { rootPaths = [hello]; }'
|
||||
```
|
||||
|
||||
```shellSession
|
||||
/nix/store/cc0562q828rnjqjyfj23d5q162gb424g-binary-cache
|
||||
```
|
||||
|
||||
Copy the resulting directory to the other machine, `host2`:
|
||||
|
||||
```shellSession
|
||||
scp result host2:/tmp/hello-cache
|
||||
```
|
||||
|
||||
Substitute the derivation using the flat-file binary cache on the other machine, `host2`:
|
||||
```shellSession
|
||||
nix-build -A hello '<nixpkgs>' \
|
||||
--option require-sigs false \
|
||||
--option trusted-substituters file:///tmp/hello-cache \
|
||||
--option substituters file:///tmp/hello-cache
|
||||
```
|
||||
|
||||
```shellSession
|
||||
/nix/store/gl5a41azbpsadfkfmbilh9yk40dh5dl0-hello-2.12.1
|
||||
```
|
||||
@@ -204,13 +204,13 @@ The key words _must_, _must not_, _required_, _shall_, _shall not_, _should_, _s
|
||||
|
||||
In Nixpkgs, there are generally three different names associated with a package:
|
||||
|
||||
- The `name` attribute of the derivation (excluding the version part). This is what most users see, in particular when using `nix-env`.
|
||||
- The `pname` attribute of the derivation. This is what most users see, in particular when using `nix-env`.
|
||||
|
||||
- The variable name used for the instantiated package in `all-packages.nix`, and when passing it as a dependency to other functions. Typically this is called the _package attribute name_. This is what Nix expression authors see. It can also be used when installing using `nix-env -iA`.
|
||||
|
||||
- The filename for (the directory containing) the Nix expression.
|
||||
|
||||
Most of the time, these are the same. For instance, the package `e2fsprogs` has a `name` attribute `"e2fsprogs-version"`, is bound to the variable name `e2fsprogs` in `all-packages.nix`, and the Nix expression is in `pkgs/os-specific/linux/e2fsprogs/default.nix`.
|
||||
Most of the time, these are the same. For instance, the package `e2fsprogs` has a `pname` attribute `"e2fsprogs"`, is bound to the variable name `e2fsprogs` in `all-packages.nix`, and the Nix expression is in `pkgs/os-specific/linux/e2fsprogs/default.nix`.
|
||||
|
||||
There are a few naming guidelines:
|
||||
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
{ pkgs ? (import ./.. { }), nixpkgs ? { }}:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
doc-support = import ./doc-support { inherit pkgs nixpkgs; };
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
name = "nixpkgs-manual";
|
||||
@@ -15,7 +14,7 @@ in pkgs.stdenv.mkDerivation {
|
||||
xmlformat
|
||||
];
|
||||
|
||||
src = lib.cleanSource ./.;
|
||||
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
|
||||
|
||||
postPatch = ''
|
||||
ln -s ${doc-support} ./doc-support/result
|
||||
|
||||
@@ -75,7 +75,7 @@ in pkgs.runCommand "doc-support" {}
|
||||
ln -s ${epub-xsl} ./epub.xsl
|
||||
ln -s ${xhtml-xsl} ./xhtml.xsl
|
||||
|
||||
ln -s ${../../nixos/doc/xmlformat.conf} ./xmlformat.conf
|
||||
ln -s ${./xmlformat.conf} ./xmlformat.conf
|
||||
ln -s ${pkgs.documentation-highlighter} ./highlightjs
|
||||
|
||||
echo -n "${version}" > ./version
|
||||
|
||||
@@ -10,9 +10,7 @@ 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`.
|
||||
:::
|
||||
|
||||
@@ -171,6 +171,7 @@ let
|
||||
inherit src version;
|
||||
# nix will complain and tell you the right value to replace this with
|
||||
hash = lib.fakeHash;
|
||||
mixEnv = ""; # default is "prod", when empty includes all dependencies, such as "dev", "test".
|
||||
# if you have build time environment variables add them here
|
||||
MY_ENV_VAR="my_value";
|
||||
};
|
||||
|
||||
@@ -137,7 +137,12 @@ set the default version to a version older than the newest on Hackage. We do
|
||||
this to get them or their reverse dependencies to compile in our package set.
|
||||
4. For all packages, for which the newest Hackage version is not the default
|
||||
version, there will also be a `haskellPackages.foo_x_y_z` package with the
|
||||
newest version.
|
||||
newest version. The `x_y_z` part encodes the version with dots replaced by
|
||||
underscores. When the newest version changes by a new release to Hackage the
|
||||
old package will disappear under that name and be replaced by a newer one under
|
||||
the name with the new version. The package name including the version will
|
||||
also disappear when the default version e.g. from Stackage catches up with the
|
||||
newest version from Hackage.
|
||||
5. For some packages, we also manually add other `haskellPackages.foo_x_y_z`
|
||||
versions, if they are required for a certain build.
|
||||
|
||||
@@ -161,12 +166,14 @@ given in the `.cabal` file of your package and all its dependencies.
|
||||
|
||||
The [Haskell builder in nixpkgs](#haskell-mkderivation) does no such thing.
|
||||
It will simply take as input packages with names off the desired dependencies
|
||||
and just check whether they fulfill the version bounds and (by default, see
|
||||
`jailbreak`) fail if they don’t.
|
||||
and just check whether they fulfill the version bounds and fail if they don’t
|
||||
(by default, see `jailbreak` to circumvent this).
|
||||
|
||||
The package resolution is done by the `haskellPackages.callPackage` function
|
||||
which will, e.g., use `haskellPackages.aeson` for a package input of name
|
||||
`aeson`.
|
||||
The `haskellPackages.callPackage` function does the package resolution.
|
||||
It will, e.g., use `haskellPackages.aeson`which has the default version as
|
||||
described above for a package input of name `aeson`. (More general:
|
||||
`<packages>.callPackage f` will call `f` with named inputs provided from the
|
||||
package set `<packages>`.)
|
||||
While this is the default behavior, it is possible to override the dependencies
|
||||
for a specific package, see
|
||||
[`override` and `overrideScope`](#haskell-overriding-haskell-packages).
|
||||
@@ -195,7 +202,7 @@ maintenance work for `haskellPackages` is required. Besides that, it is not
|
||||
possible to get the dependencies of a legacy project from nixpkgs or to use a
|
||||
specific stack solver for compiling a project.
|
||||
|
||||
Even though we couldn‘t use them directly in nixpkgs, it would be desirable
|
||||
Even though we couldn’t use them directly in nixpkgs, it would be desirable
|
||||
to have tooling to generate working Nix package sets from build plans generated
|
||||
by `cabal-install` or a specific Stackage snapshot via import-from-derivation.
|
||||
Sadly we currently don’t have tooling for this. For this you might be
|
||||
@@ -538,7 +545,7 @@ via [`shellFor`](#haskell-shellFor).
|
||||
When using `cabal-install` for dependency resolution you need to be a bit
|
||||
careful to achieve build purity. `cabal-install` will find and use all
|
||||
dependencies installed from the packages `env` via Nix, but it will also
|
||||
consult Hackage to potentially download and compile dependencies if it can‘t
|
||||
consult Hackage to potentially download and compile dependencies if it can’t
|
||||
find a valid build plan locally. To prevent this you can either never run
|
||||
`cabal update`, remove the cabal database from your `~/.cabal` folder or run
|
||||
`cabal` with `--offline`. Note though, that for some usecases `cabal2nix` needs
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<xi:include href="r.section.xml" />
|
||||
<xi:include href="ruby.section.xml" />
|
||||
<xi:include href="rust.section.xml" />
|
||||
<xi:include href="swift.section.xml" />
|
||||
<xi:include href="texlive.section.xml" />
|
||||
<xi:include href="titanium.section.xml" />
|
||||
<xi:include href="vim.section.xml" />
|
||||
|
||||
@@ -4,6 +4,48 @@
|
||||
|
||||
Nixpkgs provides a couple of facilities for working with this tool.
|
||||
|
||||
- A [setup hook](#setup-hook-pkg-config) bundled with in the `pkg-config` package, to bring a derivation's declared build inputs into the environment.
|
||||
- The [`validatePkgConfig` setup hook](https://nixos.org/manual/nixpkgs/stable/#validatepkgconfig), for packages that provide pkg-config modules.
|
||||
- The `defaultPkgConfigPackages` package set: a set of aliases, named after the modules they provide. This is meant to be used by language-to-nix integrations. Hand-written packages should use the normal Nixpkgs attribute name instead.
|
||||
## Writing packages providing pkg-config modules
|
||||
|
||||
Packages should set `meta.pkgConfigModules` with the list of package config modules they provide.
|
||||
They should also use `testers.testMetaPkgConfig` to check that the final built package matches that list.
|
||||
Additionally, the [`validatePkgConfig` setup hook](https://nixos.org/manual/nixpkgs/stable/#validatepkgconfig), will do extra checks on to-be-installed pkg-config modules.
|
||||
|
||||
A good example of all these things is zlib:
|
||||
|
||||
```
|
||||
{ pkg-config, testers, ... }:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
...
|
||||
|
||||
nativeBuildInputs = [ pkg-config validatePkgConfig ];
|
||||
|
||||
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
||||
|
||||
meta = {
|
||||
...
|
||||
pkgConfigModules = [ "zlib" ];
|
||||
};
|
||||
})
|
||||
```
|
||||
|
||||
## Accessing packages via pkg-config module name
|
||||
|
||||
### Within Nixpkgs
|
||||
|
||||
A [setup hook](#setup-hook-pkg-config) is bundled in the `pkg-config` package to bring a derivation's declared build inputs into the environment.
|
||||
This will populate environment variables like `PKG_CONFIG_PATH`, `PKG_CONFIG_PATH_FOR_BUILD`, and `PKG_CONFIG_PATH_HOST` based on:
|
||||
|
||||
- how `pkg-config` itself is depended upon
|
||||
|
||||
- how other dependencies are depended upon
|
||||
|
||||
For more details see the section on [specifying dependencies in general](#ssec-stdenv-dependencies).
|
||||
|
||||
Normal pkg-config commands to look up dependencies by name will then work with those environment variables defined by the hook.
|
||||
|
||||
### Externally
|
||||
|
||||
The `defaultPkgConfigPackages` package set is a set of aliases, named after the modules they provide.
|
||||
This is meant to be used by language-to-nix integrations.
|
||||
Hand-written packages should use the normal Nixpkgs attribute name instead.
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
# Swift {#swift}
|
||||
|
||||
The Swift compiler is provided by the `swift` package:
|
||||
|
||||
```sh
|
||||
# Compile and link a simple executable.
|
||||
nix-shell -p swift --run 'swiftc -' <<< 'print("Hello world!")'
|
||||
# Run it!
|
||||
./main
|
||||
```
|
||||
|
||||
The `swift` package also provides the `swift` command, with some caveats:
|
||||
|
||||
- Swift Package Manager (SwiftPM) is packaged separately as `swiftpm`. If you
|
||||
need functionality like `swift build`, `swift run`, `swift test`, you must
|
||||
also add the `swiftpm` package to your closure.
|
||||
- On Darwin, the `swift repl` command requires an Xcode installation. This is
|
||||
because it uses the system LLDB debugserver, which has special entitlements.
|
||||
|
||||
## Module search paths {#ssec-swift-module-search-paths}
|
||||
|
||||
Like other toolchains in Nixpkgs, the Swift compiler executables are wrapped
|
||||
to help Swift find your application's dependencies in the Nix store. These
|
||||
wrappers scan the `buildInputs` of your package derivation for specific
|
||||
directories where Swift modules are placed by convention, and automatically
|
||||
add those directories to the Swift compiler search paths.
|
||||
|
||||
Swift follows different conventions depending on the platform. The wrappers
|
||||
look for the following directories:
|
||||
|
||||
- On Darwin platforms: `lib/swift/macosx`
|
||||
(If not targeting macOS, replace `macosx` with the Xcode platform name.)
|
||||
- On other platforms: `lib/swift/linux/x86_64`
|
||||
(Where `linux` and `x86_64` are from lowercase `uname -sm`.)
|
||||
- For convenience, Nixpkgs also adds simply `lib/swift` to the search path.
|
||||
This can save a bit of work packaging Swift modules, because many Nix builds
|
||||
will produce output for just one target any way.
|
||||
|
||||
## Core libraries {#ssec-swift-core-libraries}
|
||||
|
||||
In addition to the standard library, the Swift toolchain contains some
|
||||
additional 'core libraries' that, on Apple platforms, are normally distributed
|
||||
as part of the OS or Xcode. These are packaged separately in Nixpkgs, and can
|
||||
be found (for use in `buildInputs`) as:
|
||||
|
||||
- `swiftPackages.Dispatch`
|
||||
- `swiftPackages.Foundation`
|
||||
- `swiftPackages.XCTest`
|
||||
|
||||
## Packaging with SwiftPM {#ssec-swift-packaging-with-swiftpm}
|
||||
|
||||
Nixpkgs includes a small helper `swiftpm2nix` that can fetch your SwiftPM
|
||||
dependencies for you, when you need to write a Nix expression to package your
|
||||
application.
|
||||
|
||||
The first step is to run the generator:
|
||||
|
||||
```sh
|
||||
cd /path/to/my/project
|
||||
# Enter a Nix shell with the required tools.
|
||||
nix-shell -p swift swiftpm swiftpm2nix
|
||||
# First, make sure the workspace is up-to-date.
|
||||
swift package resolve
|
||||
# Now generate the Nix code.
|
||||
swiftpm2nix
|
||||
```
|
||||
|
||||
This produces some files in a directory `nix`, which will be part of your Nix
|
||||
expression. The next step is to write that expression:
|
||||
|
||||
```nix
|
||||
{ stdenv, swift, swiftpm, swiftpm2nix, fetchFromGitHub }:
|
||||
|
||||
let
|
||||
# Pass the generated files to the helper.
|
||||
generated = swiftpm2nix.helpers ./nix;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "myproject";
|
||||
version = "0.0.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nixos";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
|
||||
};
|
||||
|
||||
# Including SwiftPM as a nativeBuildInput provides a buildPhase for you.
|
||||
# This by default performs a release build using SwiftPM, essentially:
|
||||
# swift build -c release
|
||||
nativeBuildInputs = [ swift swiftpm ];
|
||||
|
||||
# The helper provides a configure snippet that will prepare all dependencies
|
||||
# in the correct place, where SwiftPM expects them.
|
||||
configurePhase = generated.configure;
|
||||
|
||||
installPhase = ''
|
||||
# This is a special function that invokes swiftpm to find the location
|
||||
# of the binaries it produced.
|
||||
binPath="$(swiftpmBinPath)"
|
||||
# Now perform any installation steps.
|
||||
mkdir -p $out/bin
|
||||
cp $binPath/myproject $out/bin/
|
||||
'';
|
||||
}
|
||||
```
|
||||
|
||||
### Custom build flags {#ssec-swiftpm-custom-build-flags}
|
||||
|
||||
If you'd like to build a different configuration than `release`:
|
||||
|
||||
```nix
|
||||
swiftpmBuildConfig = "debug";
|
||||
```
|
||||
|
||||
It is also possible to provide additional flags to `swift build`:
|
||||
|
||||
```nix
|
||||
swiftpmFlags = [ "--disable-dead-strip" ];
|
||||
```
|
||||
|
||||
The default `buildPhase` already passes `-j` for parallel building.
|
||||
|
||||
If these two customization options are insufficient, simply provide your own
|
||||
`buildPhase` that invokes `swift build`.
|
||||
|
||||
### Running tests {#ssec-swiftpm-running-tests}
|
||||
|
||||
Including `swiftpm` in your `nativeBuildInputs` also provides a default
|
||||
`checkPhase`, but it must be enabled with:
|
||||
|
||||
```nix
|
||||
doCheck = true;
|
||||
```
|
||||
|
||||
This essentially runs: `swift test -c release`
|
||||
|
||||
### Patching dependencies {#ssec-swiftpm-patching-dependencies}
|
||||
|
||||
In some cases, it may be necessary to patch a SwiftPM dependency. SwiftPM
|
||||
dependencies are located in `.build/checkouts`, but the `swiftpm2nix` helper
|
||||
provides these as symlinks to read-only `/nix/store` paths. In order to patch
|
||||
them, we need to make them writable.
|
||||
|
||||
A special function `swiftpmMakeMutable` is available to replace the symlink
|
||||
with a writable copy:
|
||||
|
||||
```
|
||||
configurePhase = generated.configure ++ ''
|
||||
# Replace the dependency symlink with a writable copy.
|
||||
swiftpmMakeMutable swift-crypto
|
||||
# Now apply a patch.
|
||||
patch -p1 -d .build/checkouts/swift-crypto -i ${./some-fix.patch}
|
||||
'';
|
||||
```
|
||||
|
||||
## Considerations for custom build tools {#ssec-swift-considerations-for-custom-build-tools}
|
||||
|
||||
### Linking the standard library {#ssec-swift-linking-the-standard-library}
|
||||
|
||||
The `swift` package has a separate `lib` output containing just the Swift
|
||||
standard library, to prevent Swift applications needing a dependency on the
|
||||
full Swift compiler at run-time. Linking with the Nixpkgs Swift toolchain
|
||||
already ensures binaries correctly reference the `lib` output.
|
||||
|
||||
Sometimes, Swift is used only to compile part of a mixed codebase, and the
|
||||
link step is manual. Custom build tools often locate the standard library
|
||||
relative to the `swift` compiler executable, and while the result will work,
|
||||
when this path ends up in the binary, it will have the Swift compiler as an
|
||||
unintended dependency.
|
||||
|
||||
In this case, you should investigate how your build process discovers the
|
||||
standard library, and override the path. The correct path will be something
|
||||
like: `"${swift.swift.lib}/${swift.swiftModuleSubdir}"`
|
||||
+113
-15
@@ -95,6 +95,27 @@ installPhase() {
|
||||
genericBuild
|
||||
```
|
||||
|
||||
### Building a `stdenv` package in `nix-shell` {#sec-building-stdenv-package-in-nix-shell}
|
||||
|
||||
To build a `stdenv` package in a [`nix-shell`](https://nixos.org/manual/nix/unstable/command-ref/nix-shell.html), use
|
||||
|
||||
```bash
|
||||
nix-shell '<nixpkgs>' -A some_package
|
||||
eval ${unpackPhase:-unpackPhase}
|
||||
cd $sourceRoot
|
||||
eval ${patchPhase:-patchPhase}
|
||||
eval ${configurePhase:-configurePhase}
|
||||
eval ${buildPhase:-buildPhase}
|
||||
```
|
||||
|
||||
To modify a [phase](#sec-stdenv-phases), first print it with
|
||||
|
||||
```bash
|
||||
type buildPhase
|
||||
```
|
||||
|
||||
then change it in a text editor, and paste it back to the terminal.
|
||||
|
||||
## Tools provided by `stdenv` {#sec-tools-of-stdenv}
|
||||
|
||||
The standard environment provides the following packages:
|
||||
@@ -116,6 +137,82 @@ On Linux, `stdenv` also includes the `patchelf` utility.
|
||||
|
||||
## Specifying dependencies {#ssec-stdenv-dependencies}
|
||||
|
||||
Build systems often require more dependencies than just what `stdenv` provides. This section describes attributes accepted by `stdenv.mkDerivation` that can be used to make these dependencies available to the build system.
|
||||
|
||||
### Overview {#ssec-stdenv-dependencies-overview}
|
||||
|
||||
A full reference of the different kinds of dependencies is provided in [](#ssec-stdenv-dependencies-reference), but here is an overview of the most common ones.
|
||||
It should cover most use cases.
|
||||
|
||||
Add dependencies to `nativeBuildInputs` if they are executed during the build:
|
||||
- those which are needed on `$PATH` during the build, for example `cmake` and `pkg-config`
|
||||
- [setup hooks](#ssec-setup-hooks), for example [`makeWrapper`](#fun-makeWrapper)
|
||||
- interpreters needed by [`patchShebangs`](#patch-shebangs.sh) for build scripts (with the `--build` flag), which can be the case for e.g. `perl`
|
||||
|
||||
Add dependencies to `buildInputs` if they will end up copied or linked into the final output or otherwise used at runtime:
|
||||
- libraries used by compilers, for example `zlib`,
|
||||
- interpreters needed by [`patchShebangs`](#patch-shebangs.sh) for scripts which are installed, which can be the case for e.g. `perl`
|
||||
|
||||
::: {.note}
|
||||
These criteria are independent.
|
||||
|
||||
For example, software using Wayland usually needs the `wayland` library at runtime, so `wayland` should be added to `buildInputs`.
|
||||
But it also executes the `wayland-scanner` program as part of the build to generate code, so `wayland` should also be added to `nativeBuildInputs`.
|
||||
:::
|
||||
|
||||
Dependencies needed only to run tests are similarly classified between native (executed during build) and non-native (executed at runtime):
|
||||
- `nativeCheckInputs` for test tools needed on `$PATH` (such as `ctest`) and [setup hooks](#ssec-setup-hooks) (for example [`pytestCheckHook`](#python))
|
||||
- `checkInputs` for libraries linked into test executables (for example the `qcheck` OCaml package)
|
||||
|
||||
These dependencies are only injected when [`doCheck`](#var-stdenv-doCheck) is set to `true`.
|
||||
|
||||
#### Example {#ssec-stdenv-dependencies-overview-example}
|
||||
|
||||
Consider for example this simplified derivation for `solo5`, a sandboxing tool:
|
||||
```nix
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "solo5";
|
||||
version = "0.7.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/Solo5/solo5/releases/download/v${version}/solo5-v${version}.tar.gz";
|
||||
sha256 = "sha256-viwrS9lnaU8sTGuzK/+L/PlMM/xRRtgVuK5pixVeDEw=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper pkg-config ];
|
||||
buildInputs = [ libseccomp ];
|
||||
|
||||
postInstall = ''
|
||||
substituteInPlace $out/bin/solo5-virtio-mkimage \
|
||||
--replace "/usr/lib/syslinux" "${syslinux}/share/syslinux" \
|
||||
--replace "/usr/share/syslinux" "${syslinux}/share/syslinux" \
|
||||
--replace "cp " "cp --no-preserve=mode "
|
||||
|
||||
wrapProgram $out/bin/solo5-virtio-mkimage \
|
||||
--prefix PATH : ${lib.makeBinPath [ dosfstools mtools parted syslinux ]}
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
nativeCheckInputs = [ util-linux qemu ];
|
||||
checkPhase = '' [elided] '';
|
||||
}
|
||||
```
|
||||
|
||||
- `makeWrapper` is a setup hook, i.e., a shell script sourced by the generic builder of `stdenv`.
|
||||
It is thus executed during the build and must be added to `nativeBuildInputs`.
|
||||
- `pkg-config` is a build tool which the configure script of `solo5` expects to be on `$PATH` during the build:
|
||||
therefore, it must be added to `nativeBuildInputs`.
|
||||
- `libseccomp` is a library linked into `$out/bin/solo5-elftool`.
|
||||
As it is used at runtime, it must be added to `buildInputs`.
|
||||
- Tests need `qemu` and `getopt` (from `util-linux`) on `$PATH`, these must be added to `nativeCheckInputs`.
|
||||
- Some dependencies are injected directly in the shell code of phases: `syslinux`, `dosfstools`, `mtools`, and `parted`.
|
||||
In this specific case, they will end up in the output of the derivation (`$out` here).
|
||||
As Nix marks dependencies whose absolute path is present in the output as runtime dependencies, adding them to `buildInputs` is not required.
|
||||
|
||||
For more complex cases, like libraries linked into an executable which is then executed as part of the build system, see [](#ssec-stdenv-dependencies-reference).
|
||||
|
||||
### Reference {#ssec-stdenv-dependencies-reference}
|
||||
|
||||
As described in the Nix manual, almost any `*.drv` store path in a derivation’s attribute set will induce a dependency on that derivation. `mkDerivation`, however, takes a few attributes intended to include all the dependencies of a package. This is done both for structure and consistency, but also so that certain other setup can take place. For example, certain dependencies need their bin directories added to the `PATH`. That is built-in, but other setup is done via a pluggable mechanism that works in conjunction with these dependency attributes. See [](#ssec-setup-hooks) for details.
|
||||
|
||||
Dependencies can be broken down along three axes: their host and target platforms relative to the new derivation’s, and whether they are propagated. The platform distinctions are motivated by cross compilation; see [](#chap-cross) for exactly what each platform means. [^footnote-stdenv-ignored-build-platform] But even if one is not cross compiling, the platforms imply whether or not the dependency is needed at run-time or build-time, a concept that makes perfect sense outside of cross compilation. By default, the run-time/build-time distinction is just a hint for mental clarity, but with `strictDeps` set it is mostly enforced even in the native case.
|
||||
@@ -187,21 +284,21 @@ Because of the bounds checks, the uncommon cases are `h = t` and `h + 2 = t`. In
|
||||
|
||||
Overall, the unifying theme here is that propagation shouldn’t be introducing transitive dependencies involving platforms the depending package is unaware of. \[One can imagine the dependending package asking for dependencies with the platforms it knows about; other platforms it doesn’t know how to ask for. The platform description in that scenario is a kind of unforagable capability.\] The offset bounds checking and definition of `mapOffset` together ensure that this is the case. Discovering a new offset is discovering a new platform, and since those platforms weren’t in the derivation “spec” of the needing package, they cannot be relevant. From a capability perspective, we can imagine that the host and target platforms of a package are the capabilities a package requires, and the depending package must provide the capability to the dependency.
|
||||
|
||||
### Variables specifying dependencies {#variables-specifying-dependencies}
|
||||
#### Variables specifying dependencies {#variables-specifying-dependencies}
|
||||
|
||||
#### `depsBuildBuild` {#var-stdenv-depsBuildBuild}
|
||||
##### `depsBuildBuild` {#var-stdenv-depsBuildBuild}
|
||||
|
||||
A list of dependencies whose host and target platforms are the new derivation’s build platform. These are programs and libraries used at build time that produce programs and libraries also used at build time. If the dependency doesn’t care about the target platform (i.e. isn’t a compiler or similar tool), put it in `nativeBuildInputs` instead. The most common use of this `buildPackages.stdenv.cc`, the default C compiler for this role. That example crops up more than one might think in old commonly used C libraries.
|
||||
|
||||
Since these packages are able to be run at build-time, they are always added to the `PATH`, as described above. But since these packages are only guaranteed to be able to run then, they shouldn’t persist as run-time dependencies. This isn’t currently enforced, but could be in the future.
|
||||
|
||||
#### `nativeBuildInputs` {#var-stdenv-nativeBuildInputs}
|
||||
##### `nativeBuildInputs` {#var-stdenv-nativeBuildInputs}
|
||||
|
||||
A list of dependencies whose host platform is the new derivation’s build platform, and target platform is the new derivation’s host platform. These are programs and libraries used at build-time that, if they are a compiler or similar tool, produce code to run at run-time—i.e. tools used to build the new derivation. If the dependency doesn’t care about the target platform (i.e. isn’t a compiler or similar tool), put it here, rather than in `depsBuildBuild` or `depsBuildTarget`. This could be called `depsBuildHost` but `nativeBuildInputs` is used for historical continuity.
|
||||
|
||||
Since these packages are able to be run at build-time, they are added to the `PATH`, as described above. But since these packages are only guaranteed to be able to run then, they shouldn’t persist as run-time dependencies. This isn’t currently enforced, but could be in the future.
|
||||
|
||||
#### `depsBuildTarget` {#var-stdenv-depsBuildTarget}
|
||||
##### `depsBuildTarget` {#var-stdenv-depsBuildTarget}
|
||||
|
||||
A list of dependencies whose host platform is the new derivation’s build platform, and target platform is the new derivation’s target platform. These are programs used at build time that produce code to run with code produced by the depending package. Most commonly, these are tools used to build the runtime or standard library that the currently-being-built compiler will inject into any code it compiles. In many cases, the currently-being-built-compiler is itself employed for that task, but when that compiler won’t run (i.e. its build and host platform differ) this is not possible. Other times, the compiler relies on some other tool, like binutils, that is always built separately so that the dependency is unconditional.
|
||||
|
||||
@@ -209,41 +306,41 @@ This is a somewhat confusing concept to wrap one’s head around, and for good r
|
||||
|
||||
Since these packages are able to run at build time, they are added to the `PATH`, as described above. But since these packages are only guaranteed to be able to run then, they shouldn’t persist as run-time dependencies. This isn’t currently enforced, but could be in the future.
|
||||
|
||||
#### `depsHostHost` {#var-stdenv-depsHostHost}
|
||||
##### `depsHostHost` {#var-stdenv-depsHostHost}
|
||||
|
||||
A list of dependencies whose host and target platforms match the new derivation’s host platform. In practice, this would usually be tools used by compilers for macros or a metaprogramming system, or libraries used by the macros or metaprogramming code itself. It’s always preferable to use a `depsBuildBuild` dependency in the derivation being built over a `depsHostHost` on the tool doing the building for this purpose.
|
||||
|
||||
#### `buildInputs` {#var-stdenv-buildInputs}
|
||||
##### `buildInputs` {#var-stdenv-buildInputs}
|
||||
|
||||
A list of dependencies whose host platform and target platform match the new derivation’s. This would be called `depsHostTarget` but for historical continuity. If the dependency doesn’t care about the target platform (i.e. isn’t a compiler or similar tool), put it here, rather than in `depsBuildBuild`.
|
||||
|
||||
These are often programs and libraries used by the new derivation at *run*-time, but that isn’t always the case. For example, the machine code in a statically-linked library is only used at run-time, but the derivation containing the library is only needed at build-time. Even in the dynamic case, the library may also be needed at build-time to appease the linker.
|
||||
|
||||
#### `depsTargetTarget` {#var-stdenv-depsTargetTarget}
|
||||
##### `depsTargetTarget` {#var-stdenv-depsTargetTarget}
|
||||
|
||||
A list of dependencies whose host platform matches the new derivation’s target platform. These are packages that run on the target platform, e.g. the standard library or run-time deps of standard library that a compiler insists on knowing about. It’s poor form in almost all cases for a package to depend on another from a future stage \[future stage corresponding to positive offset\]. Do not use this attribute unless you are packaging a compiler and are sure it is needed.
|
||||
|
||||
#### `depsBuildBuildPropagated` {#var-stdenv-depsBuildBuildPropagated}
|
||||
##### `depsBuildBuildPropagated` {#var-stdenv-depsBuildBuildPropagated}
|
||||
|
||||
The propagated equivalent of `depsBuildBuild`. This perhaps never ought to be used, but it is included for consistency \[see below for the others\].
|
||||
|
||||
#### `propagatedNativeBuildInputs` {#var-stdenv-propagatedNativeBuildInputs}
|
||||
##### `propagatedNativeBuildInputs` {#var-stdenv-propagatedNativeBuildInputs}
|
||||
|
||||
The propagated equivalent of `nativeBuildInputs`. This would be called `depsBuildHostPropagated` but for historical continuity. For example, if package `Y` has `propagatedNativeBuildInputs = [X]`, and package `Z` has `buildInputs = [Y]`, then package `Z` will be built as if it included package `X` in its `nativeBuildInputs`. If instead, package `Z` has `nativeBuildInputs = [Y]`, then `Z` will be built as if it included `X` in the `depsBuildBuild` of package `Z`, because of the sum of the two `-1` host offsets.
|
||||
|
||||
#### `depsBuildTargetPropagated` {#var-stdenv-depsBuildTargetPropagated}
|
||||
##### `depsBuildTargetPropagated` {#var-stdenv-depsBuildTargetPropagated}
|
||||
|
||||
The propagated equivalent of `depsBuildTarget`. This is prefixed for the same reason of alerting potential users.
|
||||
|
||||
#### `depsHostHostPropagated` {#var-stdenv-depsHostHostPropagated}
|
||||
##### `depsHostHostPropagated` {#var-stdenv-depsHostHostPropagated}
|
||||
|
||||
The propagated equivalent of `depsHostHost`.
|
||||
|
||||
#### `propagatedBuildInputs` {#var-stdenv-propagatedBuildInputs}
|
||||
##### `propagatedBuildInputs` {#var-stdenv-propagatedBuildInputs}
|
||||
|
||||
The propagated equivalent of `buildInputs`. This would be called `depsHostTargetPropagated` but for historical continuity.
|
||||
|
||||
#### `depsTargetTargetPropagated` {#var-stdenv-depsTargetTargetPropagated}
|
||||
##### `depsTargetTargetPropagated` {#var-stdenv-depsTargetTargetPropagated}
|
||||
|
||||
The propagated equivalent of `depsTargetTarget`. This is prefixed for the same reason of alerting potential users.
|
||||
|
||||
@@ -626,7 +723,7 @@ Before and after running `make`, the hooks `preBuild` and `postBuild` are called
|
||||
|
||||
### The check phase {#ssec-check-phase}
|
||||
|
||||
The check phase checks whether the package was built correctly by running its test suite. The default `checkPhase` calls `make $checkTarget`, but only if the `doCheck` variable is enabled (see below).
|
||||
The check phase checks whether the package was built correctly by running its test suite. The default `checkPhase` calls `make $checkTarget`, but only if the [`doCheck` variable](#var-stdenv-doCheck) is enabled.
|
||||
|
||||
#### Variables controlling the check phase {#variables-controlling-the-check-phase}
|
||||
|
||||
@@ -646,7 +743,8 @@ See the [build phase](#var-stdenv-makeFlags) for details.
|
||||
|
||||
##### `checkTarget` {#var-stdenv-checkTarget}
|
||||
|
||||
The make target that runs the tests. Defaults to `check` if it exists, otherwise `test`; if neither is found, do nothing.
|
||||
The `make` target that runs the tests.
|
||||
If unset, use `check` if it exists, otherwise `test`; if neither is found, do nothing.
|
||||
|
||||
##### `checkFlags` / `checkFlagsArray` {#var-stdenv-checkFlags}
|
||||
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ let
|
||||
updateManyAttrsByPath;
|
||||
inherit (self.lists) singleton forEach foldr fold foldl foldl' imap0 imap1
|
||||
concatMap flatten remove findSingle findFirst any all count
|
||||
optional optionals toList range partition zipListsWith zipLists
|
||||
optional optionals toList range replicate partition zipListsWith zipLists
|
||||
reverseList listDfs toposort sort naturalSort compareLists take
|
||||
drop sublist last init crossLists unique intersectLists
|
||||
subtractLists mutuallyExclusive groupBy groupBy';
|
||||
|
||||
@@ -114,6 +114,16 @@ in mkLicense lset) ({
|
||||
fullName = "Bitstream Vera Font License";
|
||||
};
|
||||
|
||||
bitTorrent10 = {
|
||||
spdxId = "BitTorrent-1.0";
|
||||
fullName = " BitTorrent Open Source License v1.0";
|
||||
};
|
||||
|
||||
bitTorrent11 = {
|
||||
spdxId = "BitTorrent-1.1";
|
||||
fullName = " BitTorrent Open Source License v1.1";
|
||||
};
|
||||
|
||||
bola11 = {
|
||||
url = "https://blitiri.com.ar/p/bola/";
|
||||
fullName = "Buena Onda License Agreement 1.1";
|
||||
@@ -333,6 +343,13 @@ in mkLicense lset) ({
|
||||
free = false;
|
||||
};
|
||||
|
||||
ecl20 = {
|
||||
fullName = "Educational Community License, Version 2.0";
|
||||
url = "https://opensource.org/licenses/ECL-2.0";
|
||||
shortName = "ECL 2.0";
|
||||
spdxId = "ECL-2.0";
|
||||
};
|
||||
|
||||
efl10 = {
|
||||
spdxId = "EFL-1.0";
|
||||
fullName = "Eiffel Forum License v1.0";
|
||||
|
||||
@@ -303,6 +303,18 @@ rec {
|
||||
else
|
||||
genList (n: first + n) (last - first + 1);
|
||||
|
||||
/* Return a list with `n` copies of an element.
|
||||
|
||||
Type: replicate :: int -> a -> [a]
|
||||
|
||||
Example:
|
||||
replicate 3 "a"
|
||||
=> [ "a" "a" "a" ]
|
||||
replicate 2 true
|
||||
=> [ true true ]
|
||||
*/
|
||||
replicate = n: elem: genList (_: elem) n;
|
||||
|
||||
/* Splits the elements of a list in two lists, `right` and
|
||||
`wrong`, depending on the evaluation of a predicate.
|
||||
|
||||
|
||||
+5
-2
@@ -36,6 +36,9 @@ let
|
||||
inherit (lib.types)
|
||||
mkOptionType
|
||||
;
|
||||
prioritySuggestion = ''
|
||||
Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.
|
||||
'';
|
||||
in
|
||||
rec {
|
||||
|
||||
@@ -184,7 +187,7 @@ rec {
|
||||
if length defs == 1
|
||||
then (head defs).value
|
||||
else assert length defs > 1;
|
||||
throw "The option `${showOption loc}' is defined multiple times.\n${message}\nDefinition values:${showDefs defs}";
|
||||
throw "The option `${showOption loc}' is defined multiple times while it's expected to be unique.\n${message}\nDefinition values:${showDefs defs}\n${prioritySuggestion}";
|
||||
|
||||
/* "Merge" option definitions by checking that they all have the same value. */
|
||||
mergeEqualOption = loc: defs:
|
||||
@@ -195,7 +198,7 @@ rec {
|
||||
else if length defs == 1 then (head defs).value
|
||||
else (foldl' (first: def:
|
||||
if def.value != first.value then
|
||||
throw "The option `${showOption loc}' has conflicting definition values:${showDefs [ first def ]}"
|
||||
throw "The option `${showOption loc}' has conflicting definition values:${showDefs [ first def ]}\n${prioritySuggestion}"
|
||||
else
|
||||
first) (head defs) (tail defs)).value;
|
||||
|
||||
|
||||
+63
-7
@@ -4,6 +4,7 @@ let
|
||||
|
||||
inherit (builtins)
|
||||
isString
|
||||
isPath
|
||||
split
|
||||
match
|
||||
;
|
||||
@@ -25,6 +26,10 @@ let
|
||||
assertMsg
|
||||
;
|
||||
|
||||
inherit (lib.path.subpath)
|
||||
isValid
|
||||
;
|
||||
|
||||
# Return the reason why a subpath is invalid, or `null` if it's valid
|
||||
subpathInvalidReason = value:
|
||||
if ! isString value then
|
||||
@@ -94,6 +99,52 @@ let
|
||||
|
||||
in /* No rec! Add dependencies on this file at the top. */ {
|
||||
|
||||
/* Append a subpath string to a path.
|
||||
|
||||
Like `path + ("/" + string)` but safer, because it errors instead of returning potentially surprising results.
|
||||
More specifically, it checks that the first argument is a [path value type](https://nixos.org/manual/nix/stable/language/values.html#type-path"),
|
||||
and that the second argument is a valid subpath string (see `lib.path.subpath.isValid`).
|
||||
|
||||
Type:
|
||||
append :: Path -> String -> Path
|
||||
|
||||
Example:
|
||||
append /foo "bar/baz"
|
||||
=> /foo/bar/baz
|
||||
|
||||
# subpaths don't need to be normalised
|
||||
append /foo "./bar//baz/./"
|
||||
=> /foo/bar/baz
|
||||
|
||||
# can append to root directory
|
||||
append /. "foo/bar"
|
||||
=> /foo/bar
|
||||
|
||||
# first argument needs to be a path value type
|
||||
append "/foo" "bar"
|
||||
=> <error>
|
||||
|
||||
# second argument needs to be a valid subpath string
|
||||
append /foo /bar
|
||||
=> <error>
|
||||
append /foo ""
|
||||
=> <error>
|
||||
append /foo "/bar"
|
||||
=> <error>
|
||||
append /foo "../bar"
|
||||
=> <error>
|
||||
*/
|
||||
append =
|
||||
# The absolute path to append to
|
||||
path:
|
||||
# The subpath string to append
|
||||
subpath:
|
||||
assert assertMsg (isPath path) ''
|
||||
lib.path.append: The first argument is of type ${builtins.typeOf path}, but a path was expected'';
|
||||
assert assertMsg (isValid subpath) ''
|
||||
lib.path.append: Second argument is not a valid subpath string:
|
||||
${subpathInvalidReason subpath}'';
|
||||
path + ("/" + subpath);
|
||||
|
||||
/* Whether a value is a valid subpath string.
|
||||
|
||||
@@ -133,7 +184,9 @@ in /* No rec! Add dependencies on this file at the top. */ {
|
||||
subpath.isValid "./foo//bar/"
|
||||
=> true
|
||||
*/
|
||||
subpath.isValid = value:
|
||||
subpath.isValid =
|
||||
# The value to check
|
||||
value:
|
||||
subpathInvalidReason value == null;
|
||||
|
||||
|
||||
@@ -150,11 +203,11 @@ in /* No rec! Add dependencies on this file at the top. */ {
|
||||
|
||||
Laws:
|
||||
|
||||
- (Idempotency) Normalising multiple times gives the same result:
|
||||
- Idempotency - normalising multiple times gives the same result:
|
||||
|
||||
subpath.normalise (subpath.normalise p) == subpath.normalise p
|
||||
|
||||
- (Uniqueness) There's only a single normalisation for the paths that lead to the same file system node:
|
||||
- Uniqueness - there's only a single normalisation for the paths that lead to the same file system node:
|
||||
|
||||
subpath.normalise p != subpath.normalise q -> $(realpath ${p}) != $(realpath ${q})
|
||||
|
||||
@@ -210,9 +263,12 @@ in /* No rec! Add dependencies on this file at the top. */ {
|
||||
subpath.normalise "/foo"
|
||||
=> <error>
|
||||
*/
|
||||
subpath.normalise = path:
|
||||
assert assertMsg (subpathInvalidReason path == null)
|
||||
"lib.path.subpath.normalise: Argument is not a valid subpath string: ${subpathInvalidReason path}";
|
||||
joinRelPath (splitRelPath path);
|
||||
subpath.normalise =
|
||||
# The subpath string to normalise
|
||||
subpath:
|
||||
assert assertMsg (isValid subpath) ''
|
||||
lib.path.subpath.normalise: Argument is not a valid subpath string:
|
||||
${subpathInvalidReason subpath}'';
|
||||
joinRelPath (splitRelPath subpath);
|
||||
|
||||
}
|
||||
|
||||
+39
-1
@@ -3,9 +3,44 @@
|
||||
{ libpath }:
|
||||
let
|
||||
lib = import libpath;
|
||||
inherit (lib.path) subpath;
|
||||
inherit (lib.path) append subpath;
|
||||
|
||||
cases = lib.runTests {
|
||||
# Test examples from the lib.path.append documentation
|
||||
testAppendExample1 = {
|
||||
expr = append /foo "bar/baz";
|
||||
expected = /foo/bar/baz;
|
||||
};
|
||||
testAppendExample2 = {
|
||||
expr = append /foo "./bar//baz/./";
|
||||
expected = /foo/bar/baz;
|
||||
};
|
||||
testAppendExample3 = {
|
||||
expr = append /. "foo/bar";
|
||||
expected = /foo/bar;
|
||||
};
|
||||
testAppendExample4 = {
|
||||
expr = (builtins.tryEval (append "/foo" "bar")).success;
|
||||
expected = false;
|
||||
};
|
||||
testAppendExample5 = {
|
||||
expr = (builtins.tryEval (append /foo /bar)).success;
|
||||
expected = false;
|
||||
};
|
||||
testAppendExample6 = {
|
||||
expr = (builtins.tryEval (append /foo "")).success;
|
||||
expected = false;
|
||||
};
|
||||
testAppendExample7 = {
|
||||
expr = (builtins.tryEval (append /foo "/bar")).success;
|
||||
expected = false;
|
||||
};
|
||||
testAppendExample8 = {
|
||||
expr = (builtins.tryEval (append /foo "../bar")).success;
|
||||
expected = false;
|
||||
};
|
||||
|
||||
# Test examples from the lib.path.subpath.isValid documentation
|
||||
testSubpathIsValidExample1 = {
|
||||
expr = subpath.isValid null;
|
||||
expected = false;
|
||||
@@ -30,6 +65,7 @@ let
|
||||
expr = subpath.isValid "./foo//bar/";
|
||||
expected = true;
|
||||
};
|
||||
# Some extra tests
|
||||
testSubpathIsValidTwoDotsEnd = {
|
||||
expr = subpath.isValid "foo/..";
|
||||
expected = false;
|
||||
@@ -71,6 +107,7 @@ let
|
||||
expected = true;
|
||||
};
|
||||
|
||||
# Test examples from the lib.path.subpath.normalise documentation
|
||||
testSubpathNormaliseExample1 = {
|
||||
expr = subpath.normalise "foo//bar";
|
||||
expected = "./foo/bar";
|
||||
@@ -107,6 +144,7 @@ let
|
||||
expr = (builtins.tryEval (subpath.normalise "/foo")).success;
|
||||
expected = false;
|
||||
};
|
||||
# Some extra tests
|
||||
testSubpathNormaliseIsValidDots = {
|
||||
expr = subpath.normalise "./foo/.bar/.../baz...qux";
|
||||
expected = "./foo/.bar/.../baz...qux";
|
||||
|
||||
@@ -40,14 +40,21 @@ rec {
|
||||
# a superior CPU has all the features of an inferior and is able to build and test code for it
|
||||
inferiors = {
|
||||
# x86_64 Intel
|
||||
# https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
|
||||
default = [ ];
|
||||
westmere = [ ];
|
||||
sandybridge = [ "westmere" ] ++ inferiors.westmere;
|
||||
ivybridge = [ "sandybridge" ] ++ inferiors.sandybridge;
|
||||
haswell = [ "ivybridge" ] ++ inferiors.ivybridge;
|
||||
broadwell = [ "haswell" ] ++ inferiors.haswell;
|
||||
skylake = [ "broadwell" ] ++ inferiors.broadwell;
|
||||
skylake-avx512 = [ "skylake" ] ++ inferiors.skylake;
|
||||
sandybridge = [ "westmere" ] ++ inferiors.westmere;
|
||||
ivybridge = [ "sandybridge" ] ++ inferiors.sandybridge;
|
||||
haswell = [ "ivybridge" ] ++ inferiors.ivybridge;
|
||||
broadwell = [ "haswell" ] ++ inferiors.haswell;
|
||||
skylake = [ "broadwell" ] ++ inferiors.broadwell;
|
||||
skylake-avx512 = [ "skylake" ] ++ inferiors.skylake;
|
||||
cannonlake = [ "skylake-avx512" ] ++ inferiors.skylake-avx512;
|
||||
icelake-client = [ "cannonlake" ] ++ inferiors.cannonlake;
|
||||
icelake-server = [ "icelake-client" ] ++ inferiors.icelake-client;
|
||||
cascadelake = [ "skylake-avx512" ] ++ inferiors.cannonlake;
|
||||
cooperlake = [ "cascadelake" ] ++ inferiors.cascadelake;
|
||||
tigerlake = [ "icelake-server" ] ++ inferiors.icelake-server;
|
||||
|
||||
# x86_64 AMD
|
||||
# TODO: fill this (need testing)
|
||||
|
||||
@@ -479,6 +479,11 @@ runTests {
|
||||
expected = [2 30 40 42];
|
||||
};
|
||||
|
||||
testReplicate = {
|
||||
expr = replicate 3 "a";
|
||||
expected = ["a" "a" "a"];
|
||||
};
|
||||
|
||||
testToIntShouldConvertStringToInt = {
|
||||
expr = toInt "27";
|
||||
expected = 27;
|
||||
|
||||
+174
-33
@@ -76,7 +76,7 @@
|
||||
_0xB10C = {
|
||||
email = "nixpkgs@b10c.me";
|
||||
name = "0xB10C";
|
||||
github = "0xb10c";
|
||||
github = "0xB10C";
|
||||
githubId = 19157360;
|
||||
};
|
||||
_0xbe7a = {
|
||||
@@ -169,6 +169,12 @@
|
||||
githubId = 12578560;
|
||||
name = "Quinn Bohner";
|
||||
};
|
||||
_9999years = {
|
||||
email = "rbt@fastmail.com";
|
||||
github = "9999years";
|
||||
githubId = 15312184;
|
||||
name = "Rebecca Turner";
|
||||
};
|
||||
a1russell = {
|
||||
email = "adamlr6+pub@gmail.com";
|
||||
github = "a1russell";
|
||||
@@ -693,6 +699,15 @@
|
||||
fingerprint = "7FDB 17B3 C29B 5BA6 E5A9 8BB2 9FAA 63E0 9750 6D9D";
|
||||
}];
|
||||
};
|
||||
Alper-Celik = {
|
||||
email = "dev.alpercelik@gmail.com";
|
||||
name = "Alper Çelik";
|
||||
github = "Alper-Celik";
|
||||
githubId = 110625473;
|
||||
keys = [{
|
||||
fingerprint = "6B69 19DD CEE0 FAF3 5C9F 2984 FA90 C0AB 738A B873";
|
||||
}];
|
||||
};
|
||||
almac = {
|
||||
email = "alma.cemerlic@gmail.com";
|
||||
github = "a1mac";
|
||||
@@ -802,7 +817,7 @@
|
||||
notbandali = {
|
||||
name = "Amin Bandali";
|
||||
email = "bandali@gnu.org";
|
||||
github = "notbandali";
|
||||
github = "bandali0";
|
||||
githubId = 1254858;
|
||||
keys = [{
|
||||
fingerprint = "BE62 7373 8E61 6D6D 1B3A 08E8 A21A 0202 4881 6103";
|
||||
@@ -917,6 +932,12 @@
|
||||
githubId = 106511;
|
||||
name = "Andrew Kelley";
|
||||
};
|
||||
andrewsmith = {
|
||||
email = "andrew@velvet.software";
|
||||
github = "andrewsmith";
|
||||
githubId = 29887;
|
||||
name = "Andrew Smith";
|
||||
};
|
||||
andsild = {
|
||||
email = "andsild@gmail.com";
|
||||
github = "andsild";
|
||||
@@ -1396,6 +1417,12 @@
|
||||
githubId = 12958979;
|
||||
name = "Mika Naylor";
|
||||
};
|
||||
avakhrenev = {
|
||||
email = "avakhrenev@gmail.com";
|
||||
github = "avakhrenev";
|
||||
githubId = 1060224;
|
||||
name = "Alexey Vakhrenev";
|
||||
};
|
||||
avaq = {
|
||||
email = "nixpkgs@account.avaq.it";
|
||||
github = "Avaq";
|
||||
@@ -1745,7 +1772,7 @@
|
||||
benesim = {
|
||||
name = "Benjamin Isbarn";
|
||||
email = "benjamin.isbarn@gmail.com";
|
||||
github = "benesim";
|
||||
github = "BeneSim";
|
||||
githubId = 29384538;
|
||||
keys = [{
|
||||
fingerprint = "D35E C9CE E631 638F F1D8 B401 6F0E 410D C3EE D02";
|
||||
@@ -2367,6 +2394,12 @@
|
||||
github = "CaptainJawZ";
|
||||
githubId = 43111068;
|
||||
};
|
||||
CardboardTurkey = {
|
||||
name = "Kiran Ostrolenk";
|
||||
email = "kostrolenk@gmail.com";
|
||||
github = "CardboardTurkey";
|
||||
githubId = 34030186;
|
||||
};
|
||||
carlosdagos = {
|
||||
email = "m@cdagostino.io";
|
||||
github = "carlosdagos";
|
||||
@@ -3115,7 +3148,7 @@
|
||||
cust0dian = {
|
||||
email = "serg@effectful.software";
|
||||
github = "cust0dian";
|
||||
githubId = 389387;
|
||||
githubId = 119854490;
|
||||
name = "Serg Nesterov";
|
||||
keys = [{
|
||||
fingerprint = "6E7D BA30 DB5D BA60 693C 3BE3 1512 F6EB 84AE CC8C";
|
||||
@@ -3394,7 +3427,7 @@
|
||||
};
|
||||
davsanchez = {
|
||||
email = "davidslt+nixpkgs@pm.me";
|
||||
github = "davsanchez";
|
||||
github = "DavSanchez";
|
||||
githubId = 11422515;
|
||||
name = "David Sánchez";
|
||||
};
|
||||
@@ -3729,12 +3762,6 @@
|
||||
githubId = 14034137;
|
||||
name = "Mostly Void";
|
||||
};
|
||||
dizfer = {
|
||||
email = "david@izquierdofernandez.com";
|
||||
github = "DIzFer";
|
||||
githubId = 8852888;
|
||||
name = "David Izquierdo";
|
||||
};
|
||||
djacu = {
|
||||
email = "daniel.n.baker@gmail.com";
|
||||
github = "djacu";
|
||||
@@ -3840,6 +3867,12 @@
|
||||
githubId = 39825;
|
||||
name = "Dominik Honnef";
|
||||
};
|
||||
doriath = {
|
||||
email = "tomasz.zurkowski@gmail.com";
|
||||
github = "doriath";
|
||||
githubId = 150959;
|
||||
name = "Tomasz Zurkowski";
|
||||
};
|
||||
doronbehar = {
|
||||
email = "me@doronbehar.com";
|
||||
github = "doronbehar";
|
||||
@@ -3881,6 +3914,7 @@
|
||||
name = "Davide Peressoni";
|
||||
email = "davide.peressoni@tuta.io";
|
||||
matrix = "@dpd-:matrix.org";
|
||||
github = "DPDmancul";
|
||||
githubId = 3186857;
|
||||
};
|
||||
dpercy = {
|
||||
@@ -4311,7 +4345,7 @@
|
||||
};
|
||||
elnudev = {
|
||||
email = "elnu@elnu.com";
|
||||
github = "elnudev";
|
||||
github = "ElnuDev";
|
||||
githubId = 9874955;
|
||||
name = "Elnu";
|
||||
};
|
||||
@@ -4599,7 +4633,7 @@
|
||||
};
|
||||
ewok = {
|
||||
email = "ewok@ewok.ru";
|
||||
github = "ewok";
|
||||
github = "ewok-old";
|
||||
githubId = 454695;
|
||||
name = "Artur Taranchiev";
|
||||
};
|
||||
@@ -5154,6 +5188,12 @@
|
||||
githubId = 606000;
|
||||
name = "Gabriel Adomnicai";
|
||||
};
|
||||
garaiza-93 = {
|
||||
email = "araizagustavo93@gmail.com";
|
||||
github = "garaiza-93";
|
||||
githubId = 57430880;
|
||||
name = "Gustavo Araiza";
|
||||
};
|
||||
Gabriel439 = {
|
||||
email = "Gabriel439@gmail.com";
|
||||
github = "Gabriella439";
|
||||
@@ -5254,6 +5294,15 @@
|
||||
githubId = 313929;
|
||||
name = "Gabriel Ebner";
|
||||
};
|
||||
genericnerdyusername = {
|
||||
name = "GenericNerdyUsername";
|
||||
email = "genericnerdyusername@proton.me";
|
||||
github = "GenericNerdyUsername";
|
||||
githubId = 111183546;
|
||||
keys = [{
|
||||
fingerprint = "58CE D4BE 6B10 149E DA80 A990 2F48 6356 A4CB 30F3";
|
||||
}];
|
||||
};
|
||||
genofire = {
|
||||
name = "genofire";
|
||||
email = "geno+dev@fireorbit.de";
|
||||
@@ -5721,7 +5770,7 @@
|
||||
};
|
||||
harrisonthorne = {
|
||||
email = "harrisonthorne@proton.me";
|
||||
github = "harrisonthorne";
|
||||
github = "muni-corn";
|
||||
githubId = 33523827;
|
||||
name = "Harrison Thorne";
|
||||
};
|
||||
@@ -6062,6 +6111,12 @@
|
||||
githubId = 1592375;
|
||||
name = "Walter Huf";
|
||||
};
|
||||
hughobrien = {
|
||||
email = "github@hughobrien.ie";
|
||||
github = "hughobrien";
|
||||
githubId = 3400690;
|
||||
name = "Hugh O'Brien";
|
||||
};
|
||||
hugolgst = {
|
||||
email = "hugo.lageneste@pm.me";
|
||||
github = "hugolgst";
|
||||
@@ -6638,6 +6693,12 @@
|
||||
github = "jayeshbhoot";
|
||||
githubId = 1915507;
|
||||
};
|
||||
jayman2000 = {
|
||||
email = "jason@jasonyundt.email";
|
||||
github = "Jayman2000";
|
||||
githubId = 5579359;
|
||||
name = "Jason Yundt";
|
||||
};
|
||||
jb55 = {
|
||||
email = "jb55@jb55.com";
|
||||
github = "jb55";
|
||||
@@ -6944,7 +7005,7 @@
|
||||
};
|
||||
jkarlson = {
|
||||
email = "jekarlson@gmail.com";
|
||||
github = "jkarlson";
|
||||
github = "ethorsoe";
|
||||
githubId = 1204734;
|
||||
name = "Emil Karlson";
|
||||
};
|
||||
@@ -7015,6 +7076,12 @@
|
||||
githubId = 2308444;
|
||||
name = "Joshua Gilman";
|
||||
};
|
||||
jnsgruk = {
|
||||
email = "jon@sgrs.uk";
|
||||
github = "jnsgruk";
|
||||
githubId = 668505;
|
||||
name = "Jon Seager";
|
||||
};
|
||||
jo1gi = {
|
||||
email = "joakimholm@protonmail.com";
|
||||
github = "jo1gi";
|
||||
@@ -7226,6 +7293,12 @@
|
||||
github = "jorsn";
|
||||
githubId = 4646725;
|
||||
};
|
||||
joshniemela = {
|
||||
name = "Joshua Niemelä";
|
||||
email = "josh@jniemela.dk";
|
||||
github = "joshniemela";
|
||||
githubId = 88747315;
|
||||
};
|
||||
joshuafern = {
|
||||
name = "Joshua Fern";
|
||||
email = "joshuafern@protonmail.com";
|
||||
@@ -7716,7 +7789,7 @@
|
||||
name = "Kid";
|
||||
};
|
||||
kidsan = {
|
||||
github = "kidsan";
|
||||
github = "Kidsan";
|
||||
githubId = 8798449;
|
||||
name = "kidsan";
|
||||
};
|
||||
@@ -8506,6 +8579,12 @@
|
||||
githubId = 22085373;
|
||||
name = "Luis Hebendanz";
|
||||
};
|
||||
luizirber = {
|
||||
email = "nixpkgs@luizirber.org";
|
||||
github = "luizirber";
|
||||
githubId = 6642;
|
||||
name = "Luiz Irber";
|
||||
};
|
||||
luizribeiro = {
|
||||
email = "nixpkgs@l9o.dev";
|
||||
matrix = "@luizribeiro:matrix.org";
|
||||
@@ -8613,6 +8692,8 @@
|
||||
loveisgrief = {
|
||||
name = "LoveIsGrief";
|
||||
email = "loveisgrief@tuta.io";
|
||||
github = "LoveIsGrief";
|
||||
githubId = 2829538;
|
||||
keys = [{
|
||||
fingerprint = "9847 4F48 18C6 4E0A F0C5 3529 E96D 1EDF A053 45EB";
|
||||
}];
|
||||
@@ -8764,7 +8845,7 @@
|
||||
};
|
||||
lux = {
|
||||
email = "lux@lux.name";
|
||||
github = "luxferresum";
|
||||
github = "luxzeitlos";
|
||||
githubId = 1208273;
|
||||
matrix = "@lux:ontheblueplanet.com";
|
||||
name = "Lux";
|
||||
@@ -8918,8 +8999,8 @@
|
||||
githubId = 2914269;
|
||||
name = "Malo Bourgon";
|
||||
};
|
||||
malvo = {
|
||||
email = "malte@malvo.org";
|
||||
malte-v = {
|
||||
email = "nixpkgs@mal.tc";
|
||||
github = "malte-v";
|
||||
githubId = 34393802;
|
||||
name = "Malte Voos";
|
||||
@@ -9243,7 +9324,7 @@
|
||||
};
|
||||
maxwell-lt = {
|
||||
email = "maxwell.lt@live.com";
|
||||
github = "maxwell-lt";
|
||||
github = "Maxwell-lt";
|
||||
githubId = 17859747;
|
||||
name = "Maxwell L-T";
|
||||
};
|
||||
@@ -9882,7 +9963,7 @@
|
||||
name = "Mon Aaraj";
|
||||
email = "owo69uwu69@gmail.com";
|
||||
matrix = "@mon:tchncs.de";
|
||||
github = "MonAaraj";
|
||||
github = "ribosomerocker";
|
||||
githubId = 46468162;
|
||||
};
|
||||
monsieurp = {
|
||||
@@ -9993,6 +10074,12 @@
|
||||
githubId = 3073833;
|
||||
name = "Massimo Redaelli";
|
||||
};
|
||||
mrityunjaygr8 = {
|
||||
email = "mrityunjaysaxena1996@gmail.com";
|
||||
github = "mrityunjaygr8";
|
||||
name = "Mrityunjay Saxena";
|
||||
githubId = 14573967;
|
||||
};
|
||||
mrkkrp = {
|
||||
email = "markkarpov92@gmail.com";
|
||||
github = "mrkkrp";
|
||||
@@ -10125,7 +10212,7 @@
|
||||
munksgaard = {
|
||||
name = "Philip Munksgaard";
|
||||
email = "philip@munksgaard.me";
|
||||
github = "munksgaard";
|
||||
github = "Munksgaard";
|
||||
githubId = 230613;
|
||||
matrix = "@philip:matrix.munksgaard.me";
|
||||
keys = [{
|
||||
@@ -10460,6 +10547,12 @@
|
||||
github = "nikstur";
|
||||
githubId = 61635709;
|
||||
};
|
||||
nintron = {
|
||||
email = "nintron@sent.com";
|
||||
github = "Nintron27";
|
||||
githubId = 47835714;
|
||||
name = "Nintron";
|
||||
};
|
||||
ngerstle = {
|
||||
name = "Nicholas Gerstle";
|
||||
email = "ngerstle@gmail.com";
|
||||
@@ -10742,7 +10835,7 @@
|
||||
};
|
||||
nrhelmi = {
|
||||
email = "helmiinour@gmail.com";
|
||||
github = "nrhelmi";
|
||||
github = "NRHelmi";
|
||||
githubId = 15707703;
|
||||
name = "Helmi Nour";
|
||||
};
|
||||
@@ -11119,7 +11212,7 @@
|
||||
};
|
||||
paddygord = {
|
||||
email = "pgpatrickgordon@gmail.com";
|
||||
github = "paddygord";
|
||||
github = "avaunit02";
|
||||
githubId = 10776658;
|
||||
name = "Patrick Gordon";
|
||||
};
|
||||
@@ -11242,6 +11335,12 @@
|
||||
githubId = 15645854;
|
||||
name = "Brad Christensen";
|
||||
};
|
||||
paveloom = {
|
||||
email = "paveloom@riseup.net";
|
||||
github = "paveloom";
|
||||
githubId = 49961859;
|
||||
name = "Pavel Sobolev";
|
||||
};
|
||||
payas = {
|
||||
email = "relekarpayas@gmail.com";
|
||||
github = "bhankas";
|
||||
@@ -12169,7 +12268,7 @@
|
||||
};
|
||||
ratsclub = {
|
||||
email = "victor@freire.dev.br";
|
||||
github = "vtrf";
|
||||
github = "ratsclub";
|
||||
githubId = 25647735;
|
||||
name = "Victor Freire";
|
||||
};
|
||||
@@ -12433,7 +12532,7 @@
|
||||
};
|
||||
rika = {
|
||||
email = "rika@paymentswit.ch";
|
||||
github = "NekomimiScience";
|
||||
github = "ScarletHg";
|
||||
githubId = 1810487;
|
||||
name = "Rika";
|
||||
};
|
||||
@@ -12779,6 +12878,12 @@
|
||||
githubId = 5236428;
|
||||
name = "Gaëtan André";
|
||||
};
|
||||
rvnstn = {
|
||||
email = "github@rvnstn.de";
|
||||
github = "rvnstn";
|
||||
githubId = 2364742;
|
||||
name = "Tobias Ravenstein";
|
||||
};
|
||||
rvolosatovs = {
|
||||
email = "rvolosatovs@riseup.net";
|
||||
github = "rvolosatovs";
|
||||
@@ -13234,6 +13339,12 @@
|
||||
githubId = 38824235;
|
||||
name = "Serge Belov";
|
||||
};
|
||||
serge_sans_paille = {
|
||||
email = "serge.guelton@telecom-bretagne.eu";
|
||||
github = "serge-sans-paille";
|
||||
githubId = 863807;
|
||||
name = "Serge Guelton";
|
||||
};
|
||||
sersorrel = {
|
||||
email = "ash@sorrel.sh";
|
||||
github = "sersorrel";
|
||||
@@ -13326,6 +13437,12 @@
|
||||
githubId = 16765155;
|
||||
name = "Shardul Baral";
|
||||
};
|
||||
sharzy = {
|
||||
email = "me@sharzy.in";
|
||||
github = "SharzyL";
|
||||
githubId = 46294732;
|
||||
name = "Sharzy";
|
||||
};
|
||||
shawndellysse = {
|
||||
email = "sdellysse@gmail.com";
|
||||
github = "sdellysse";
|
||||
@@ -13416,7 +13533,7 @@
|
||||
shreerammodi = {
|
||||
name = "Shreeram Modi";
|
||||
email = "shreerammodi10@gmail.com";
|
||||
github = "Shrimpram";
|
||||
github = "shrimpram";
|
||||
githubId = 67710369;
|
||||
keys = [{
|
||||
fingerprint = "EA88 EA07 26E9 6CBF 6365 3966 163B 16EE 76ED 24CE";
|
||||
@@ -13651,6 +13768,12 @@
|
||||
githubId = 57048005;
|
||||
name = "snicket2100";
|
||||
};
|
||||
sno2wman = {
|
||||
name = "SnO2WMaN";
|
||||
email = "me@sno2wman.net";
|
||||
github = "SnO2WMaN";
|
||||
githubId = 15155608;
|
||||
};
|
||||
snpschaaf = {
|
||||
email = "philipe.schaaf@secunet.com";
|
||||
name = "Philippe Schaaf";
|
||||
@@ -14374,6 +14497,12 @@
|
||||
githubId = 139251;
|
||||
name = "Tom Hunger";
|
||||
};
|
||||
tehmatt = {
|
||||
name = "tehmatt";
|
||||
email = "nix@programsareproofs.com";
|
||||
github = "tehmatt";
|
||||
githubId = 3358866;
|
||||
};
|
||||
tejasag = {
|
||||
name = "Tejas Agarwal";
|
||||
email = "tejasagarwalbly@gmail.com";
|
||||
@@ -14396,7 +14525,7 @@
|
||||
};
|
||||
teozkr = {
|
||||
email = "teo@nullable.se";
|
||||
github = "teozkr";
|
||||
github = "nightkr";
|
||||
githubId = 649832;
|
||||
name = "Teo Klestrup Röijezon";
|
||||
};
|
||||
@@ -14810,7 +14939,7 @@
|
||||
};
|
||||
toastal = {
|
||||
email = "toastal+nix@posteo.net";
|
||||
matrix = "@toastal:matrix.org";
|
||||
matrix = "@toastal:chat.mozilla.org";
|
||||
github = "toastal";
|
||||
githubId = 561087;
|
||||
name = "toastal";
|
||||
@@ -14883,7 +15012,7 @@
|
||||
};
|
||||
tonyshkurenko = {
|
||||
email = "support@twingate.com";
|
||||
github = "tonyshkurenko";
|
||||
github = "antonshkurenko";
|
||||
githubId = 8597964;
|
||||
name = "Anton Shkurenko";
|
||||
};
|
||||
@@ -15222,7 +15351,7 @@
|
||||
};
|
||||
uthar = {
|
||||
email = "galkowskikasper@gmail.com";
|
||||
github = "uthar";
|
||||
github = "Uthar";
|
||||
githubId = 15697697;
|
||||
name = "Kasper Gałkowski";
|
||||
};
|
||||
@@ -15270,6 +15399,12 @@
|
||||
githubId = 27813;
|
||||
name = "Vincent Breitmoser";
|
||||
};
|
||||
vamega = {
|
||||
email = "github@madiathv.com";
|
||||
github = "vamega";
|
||||
githubId = 223408;
|
||||
name = "Varun Madiath";
|
||||
};
|
||||
vandenoever = {
|
||||
email = "jos@vandenoever.info";
|
||||
github = "vandenoever";
|
||||
@@ -16048,6 +16183,12 @@
|
||||
githubId = 2242427;
|
||||
name = "Yoann Ono";
|
||||
};
|
||||
yajo = {
|
||||
email = "yajo.sk8@gmail.com";
|
||||
github = "yajo";
|
||||
githubId = 973709;
|
||||
name = "Jairo Llopis";
|
||||
};
|
||||
yana = {
|
||||
email = "yana@riseup.net";
|
||||
github = "yanalunaterra";
|
||||
@@ -16340,7 +16481,7 @@
|
||||
zebreus = {
|
||||
matrix = "@lennart:cicen.net";
|
||||
email = "lennarteichhorn+nixpkgs@gmail.com";
|
||||
github = "Zebreus";
|
||||
github = "zebreus";
|
||||
githubId = 1557253;
|
||||
name = "Lennart Eichhorn";
|
||||
};
|
||||
@@ -16406,7 +16547,7 @@
|
||||
name = "zimbatm";
|
||||
};
|
||||
Zimmi48 = {
|
||||
email = "theo.zimmermann@univ-paris-diderot.fr";
|
||||
email = "theo.zimmermann@telecom-paris.fr";
|
||||
github = "Zimmi48";
|
||||
githubId = 1108325;
|
||||
name = "Théo Zimmermann";
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
# Nix script to lookup maintainer github handles from their email address. Used by ./hydra-report.hs.
|
||||
#
|
||||
# This script produces an attr set mapping of email addresses to GitHub handles:
|
||||
#
|
||||
# ```nix
|
||||
# > import ./maintainer-handles.nix
|
||||
# { "cdep.illabout@gmail.com" = "cdepillabout"; "john@smith.com" = "johnsmith"; ... }
|
||||
# ```
|
||||
#
|
||||
# This mapping contains all maintainers in ../../mainatainer-list.nix, but it
|
||||
# ignores maintainers who don't have a GitHub account or an email address.
|
||||
let
|
||||
pkgs = import ../../.. {};
|
||||
maintainers = import ../../maintainer-list.nix;
|
||||
inherit (pkgs) lib;
|
||||
mkMailGithubPair = _: maintainer: if maintainer ? github then { "${maintainer.email}" = maintainer.github; } else {};
|
||||
mkMailGithubPair = _: maintainer:
|
||||
if (maintainer ? email) && (maintainer ? github) then
|
||||
{ "${maintainer.email}" = maintainer.github; }
|
||||
else
|
||||
{};
|
||||
in lib.zipAttrsWith (_: builtins.head) (lib.mapAttrsToList mkMailGithubPair maintainers)
|
||||
|
||||
@@ -312,6 +312,19 @@ with lib.maintainers; {
|
||||
enableFeatureFreezePing = true;
|
||||
};
|
||||
|
||||
graalvm-ce = {
|
||||
members = [
|
||||
bandresen
|
||||
hlolli
|
||||
glittershark
|
||||
babariviere
|
||||
ericdallo
|
||||
thiagokokada
|
||||
];
|
||||
scope = "Maintain GraalVM Community Edition packages.";
|
||||
shortName = "GraalVM-CE";
|
||||
};
|
||||
|
||||
haskell = {
|
||||
members = [
|
||||
cdepillabout
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
generated
|
||||
manual-combined.xml
|
||||
@@ -1,30 +0,0 @@
|
||||
.PHONY: all
|
||||
all: manual-combined.xml
|
||||
|
||||
.PHONY: debug
|
||||
debug: generated manual-combined.xml
|
||||
|
||||
manual-combined.xml: generated *.xml **/*.xml
|
||||
rm -f ./manual-combined.xml
|
||||
nix-shell --pure -Q --packages xmloscopy \
|
||||
--run "xmloscopy --docbook5 ./manual.xml ./manual-combined.xml"
|
||||
|
||||
.PHONY: format
|
||||
format:
|
||||
nix-shell --pure -Q --packages xmlformat \
|
||||
--run "find ../../ -iname '*.xml' -type f -print0 | xargs -0 -I{} -n1 \
|
||||
xmlformat --config-file '../xmlformat.conf' -i {}"
|
||||
|
||||
.PHONY: fix-misc-xml
|
||||
fix-misc-xml:
|
||||
find . -iname '*.xml' -type f \
|
||||
-exec ../varlistentry-fixer.rb {} ';'
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f manual-combined.xml generated
|
||||
|
||||
generated:
|
||||
nix-build ../../release.nix \
|
||||
--attr manualGeneratedSources.x86_64-linux \
|
||||
--out-link ./generated
|
||||
@@ -21,8 +21,8 @@ which is often not what you want. By contrast, in the imperative
|
||||
approach, containers are configured and updated independently from the
|
||||
host system.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="imperative-containers.section.xml" />
|
||||
<xi:include href="declarative-containers.section.xml" />
|
||||
<xi:include href="container-networking.section.xml" />
|
||||
```{=include=} sections
|
||||
imperative-containers.section.md
|
||||
declarative-containers.section.md
|
||||
container-networking.section.md
|
||||
```
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# Administration {#ch-running}
|
||||
|
||||
This chapter describes various aspects of managing a running NixOS system, such as how to use the {command}`systemd` service manager.
|
||||
|
||||
```{=include=} chapters
|
||||
service-mgmt.chapter.md
|
||||
rebooting.chapter.md
|
||||
user-sessions.chapter.md
|
||||
control-groups.chapter.md
|
||||
logging.chapter.md
|
||||
cleaning-store.chapter.md
|
||||
containers.chapter.md
|
||||
troubleshooting.chapter.md
|
||||
```
|
||||
@@ -1,21 +0,0 @@
|
||||
<part xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
version="5.0"
|
||||
xml:id="ch-running">
|
||||
<title>Administration</title>
|
||||
<partintro xml:id="ch-running-intro">
|
||||
<para>
|
||||
This chapter describes various aspects of managing a running NixOS system,
|
||||
such as how to use the <command>systemd</command> service manager.
|
||||
</para>
|
||||
</partintro>
|
||||
<xi:include href="../from_md/administration/service-mgmt.chapter.xml" />
|
||||
<xi:include href="../from_md/administration/rebooting.chapter.xml" />
|
||||
<xi:include href="../from_md/administration/user-sessions.chapter.xml" />
|
||||
<xi:include href="../from_md/administration/control-groups.chapter.xml" />
|
||||
<xi:include href="../from_md/administration/logging.chapter.xml" />
|
||||
<xi:include href="../from_md/administration/cleaning-store.chapter.xml" />
|
||||
<xi:include href="../from_md/administration/containers.chapter.xml" />
|
||||
<xi:include href="../from_md/administration/troubleshooting.chapter.xml" />
|
||||
</part>
|
||||
@@ -3,10 +3,10 @@
|
||||
This chapter describes solutions to common problems you might encounter
|
||||
when you manage your NixOS system.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="boot-problems.section.xml" />
|
||||
<xi:include href="maintenance-mode.section.xml" />
|
||||
<xi:include href="rollback.section.xml" />
|
||||
<xi:include href="store-corruption.section.xml" />
|
||||
<xi:include href="network-problems.section.xml" />
|
||||
```{=include=} sections
|
||||
boot-problems.section.md
|
||||
maintenance-mode.section.md
|
||||
rollback.section.md
|
||||
store-corruption.section.md
|
||||
network-problems.section.md
|
||||
```
|
||||
|
||||
@@ -11,8 +11,8 @@ manual](https://nixos.org/nix/manual/#chap-writing-nix-expressions), but
|
||||
here we give a short overview of the most important constructs useful in
|
||||
NixOS configuration files.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="config-file.section.xml" />
|
||||
<xi:include href="abstractions.section.xml" />
|
||||
<xi:include href="modularity.section.xml" />
|
||||
```{=include=} sections
|
||||
config-file.section.md
|
||||
abstractions.section.md
|
||||
modularity.section.md
|
||||
```
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Configuration {#ch-configuration}
|
||||
|
||||
This chapter describes how to configure various aspects of a NixOS machine through the configuration file {file}`/etc/nixos/configuration.nix`. As described in [](#sec-changing-config), changes to this file only take effect after you run {command}`nixos-rebuild`.
|
||||
|
||||
```{=include=} chapters
|
||||
config-syntax.chapter.md
|
||||
package-mgmt.chapter.md
|
||||
user-mgmt.chapter.md
|
||||
file-systems.chapter.md
|
||||
x-windows.chapter.md
|
||||
wayland.chapter.md
|
||||
gpu-accel.chapter.md
|
||||
xfce.chapter.md
|
||||
networking.chapter.md
|
||||
linux-kernel.chapter.md
|
||||
subversion.chapter.md
|
||||
```
|
||||
|
||||
```{=include=} chapters
|
||||
@MODULE_CHAPTERS@
|
||||
```
|
||||
|
||||
```{=include=} chapters
|
||||
profiles.chapter.md
|
||||
kubernetes.chapter.md
|
||||
```
|
||||
<!-- Apache; libvirtd virtualisation -->
|
||||
@@ -1,31 +0,0 @@
|
||||
<part xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
version="5.0"
|
||||
xml:id="ch-configuration">
|
||||
<title>Configuration</title>
|
||||
<partintro xml:id="ch-configuration-intro">
|
||||
<para>
|
||||
This chapter describes how to configure various aspects of a NixOS machine
|
||||
through the configuration file
|
||||
<filename>/etc/nixos/configuration.nix</filename>. As described in
|
||||
<xref linkend="sec-changing-config" />, changes to this file only take
|
||||
effect after you run <command>nixos-rebuild</command>.
|
||||
</para>
|
||||
</partintro>
|
||||
<xi:include href="../from_md/configuration/config-syntax.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/package-mgmt.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/user-mgmt.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/file-systems.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/x-windows.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/wayland.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/gpu-accel.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/xfce.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/networking.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/linux-kernel.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/subversion.chapter.xml" />
|
||||
<xi:include href="../generated/modules.xml" xpointer="xpointer(//section[@id='modules']/*)" />
|
||||
<xi:include href="../from_md/configuration/profiles.chapter.xml" />
|
||||
<xi:include href="../from_md/configuration/kubernetes.chapter.xml" />
|
||||
<!-- Apache; libvirtd virtualisation -->
|
||||
</part>
|
||||
@@ -40,7 +40,7 @@ configuration use `pkgs` prefix (variable).
|
||||
To "uninstall" a package, simply remove it from
|
||||
[](#opt-environment.systemPackages) and run `nixos-rebuild switch`.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="customizing-packages.section.xml" />
|
||||
<xi:include href="adding-custom-packages.section.xml" />
|
||||
```{=include=} sections
|
||||
customizing-packages.section.md
|
||||
adding-custom-packages.section.md
|
||||
```
|
||||
|
||||
@@ -36,7 +36,7 @@ dropping you to the emergency shell. You can make a mount asynchronous
|
||||
and non-critical by adding `options = [ "nofail" ];`.
|
||||
:::
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="luks-file-systems.section.xml" />
|
||||
<xi:include href="sshfs-file-systems.section.xml" />
|
||||
```{=include=} sections
|
||||
luks-file-systems.section.md
|
||||
sshfs-file-systems.section.md
|
||||
```
|
||||
|
||||
@@ -67,7 +67,13 @@ When using multiple modules, you may need to access configuration values
|
||||
defined in other modules. This is what the `config` function argument is
|
||||
for: it contains the complete, merged system configuration. That is,
|
||||
`config` is the result of combining the configurations returned by every
|
||||
module [^1] . For example, here is a module that adds some packages to
|
||||
module. (If you're wondering how it's possible that the (indirect) *result*
|
||||
of a function is passed as an *input* to that same function: that's
|
||||
because Nix is a "lazy" language --- it only computes values when
|
||||
they are needed. This works as long as no individual configuration
|
||||
value depends on itself.)
|
||||
|
||||
For example, here is a module that adds some packages to
|
||||
[](#opt-environment.systemPackages) only if
|
||||
[](#opt-services.xserver.enable) is set to `true` somewhere else:
|
||||
|
||||
@@ -125,9 +131,3 @@ in
|
||||
|
||||
{ imports = [ (netConfig "nixos.localdomain") ]; }
|
||||
```
|
||||
|
||||
[^1]: If you're wondering how it's possible that the (indirect) *result*
|
||||
of a function is passed as an *input* to that same function: that's
|
||||
because Nix is a "lazy" language --- it only computes values when
|
||||
they are needed. This works as long as no individual configuration
|
||||
value depends on itself.
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
This section describes how to configure networking components
|
||||
on your NixOS machine.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="network-manager.section.xml" />
|
||||
<xi:include href="ssh.section.xml" />
|
||||
<xi:include href="ipv4-config.section.xml" />
|
||||
<xi:include href="ipv6-config.section.xml" />
|
||||
<xi:include href="firewall.section.xml" />
|
||||
<xi:include href="wireless.section.xml" />
|
||||
<xi:include href="ad-hoc-network-config.section.xml" />
|
||||
<xi:include href="renaming-interfaces.section.xml" />
|
||||
```{=include=} sections
|
||||
network-manager.section.md
|
||||
ssh.section.md
|
||||
ipv4-config.section.md
|
||||
ipv6-config.section.md
|
||||
firewall.section.md
|
||||
wireless.section.md
|
||||
ad-hoc-network-config.section.md
|
||||
renaming-interfaces.section.md
|
||||
```
|
||||
<!-- TODO: OpenVPN, NAT -->
|
||||
|
||||
@@ -12,7 +12,7 @@ NixOS has two distinct styles of package management:
|
||||
`nix-env` command. This style allows mixing packages from different
|
||||
Nixpkgs versions. It's the only choice for non-root users.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="declarative-packages.section.xml" />
|
||||
<xi:include href="ad-hoc-packages.section.xml" />
|
||||
```{=include=} sections
|
||||
declarative-packages.section.md
|
||||
ad-hoc-packages.section.md
|
||||
```
|
||||
|
||||
@@ -19,16 +19,16 @@ install media, many are actually intended to be used in real installs.
|
||||
What follows is a brief explanation on the purpose and use-case for each
|
||||
profile. Detailing each option configured by each one is out of scope.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="profiles/all-hardware.section.xml" />
|
||||
<xi:include href="profiles/base.section.xml" />
|
||||
<xi:include href="profiles/clone-config.section.xml" />
|
||||
<xi:include href="profiles/demo.section.xml" />
|
||||
<xi:include href="profiles/docker-container.section.xml" />
|
||||
<xi:include href="profiles/graphical.section.xml" />
|
||||
<xi:include href="profiles/hardened.section.xml" />
|
||||
<xi:include href="profiles/headless.section.xml" />
|
||||
<xi:include href="profiles/installation-device.section.xml" />
|
||||
<xi:include href="profiles/minimal.section.xml" />
|
||||
<xi:include href="profiles/qemu-guest.section.xml" />
|
||||
```{=include=} sections
|
||||
profiles/all-hardware.section.md
|
||||
profiles/base.section.md
|
||||
profiles/clone-config.section.md
|
||||
profiles/demo.section.md
|
||||
profiles/docker-container.section.md
|
||||
profiles/graphical.section.md
|
||||
profiles/hardened.section.md
|
||||
profiles/headless.section.md
|
||||
profiles/installation-device.section.md
|
||||
profiles/minimal.section.md
|
||||
profiles/qemu-guest.section.md
|
||||
```
|
||||
|
||||
@@ -8,7 +8,7 @@ It means that if you have SSH access to a machine, no additional setup is needed
|
||||
|
||||
## Interactive mounting {#sec-sshfs-interactive}
|
||||
|
||||
In NixOS, SSHFS is packaged as <package>sshfs</package>.
|
||||
In NixOS, SSHFS is packaged as `sshfs`.
|
||||
Once installed, mounting a directory interactively is simple as running:
|
||||
```ShellSession
|
||||
$ sshfs my-user@example.com:/my-dir /mnt/my-dir
|
||||
|
||||
@@ -69,7 +69,7 @@ Wine, you should also set the following:
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
```
|
||||
|
||||
## Auto-login {#sec-x11-auto-login .unnumbered}
|
||||
## Auto-login {#sec-x11-auto-login}
|
||||
|
||||
The x11 login screen can be skipped entirely, automatically logging you
|
||||
into your window manager and desktop environment when you boot your
|
||||
@@ -96,7 +96,7 @@ services.xserver.displayManager.autoLogin.enable = true;
|
||||
services.xserver.displayManager.autoLogin.user = "alice";
|
||||
```
|
||||
|
||||
## Intel Graphics drivers {#sec-x11--graphics-cards-intel .unnumbered}
|
||||
## Intel Graphics drivers {#sec-x11--graphics-cards-intel}
|
||||
|
||||
There are two choices for Intel Graphics drivers in X.org: `modesetting`
|
||||
(included in the xorg-server itself) and `intel` (provided by the
|
||||
@@ -136,7 +136,7 @@ services.xserver.deviceSection = ''
|
||||
Note that this will likely downgrade the performance compared to
|
||||
`modesetting` or `intel` with DRI 3 (default).
|
||||
|
||||
## Proprietary NVIDIA drivers {#sec-x11-graphics-cards-nvidia .unnumbered}
|
||||
## Proprietary NVIDIA drivers {#sec-x11-graphics-cards-nvidia}
|
||||
|
||||
NVIDIA provides a proprietary driver for its graphics cards that has
|
||||
better 3D performance than the X.org drivers. It is not enabled by
|
||||
@@ -158,7 +158,7 @@ services.xserver.videoDrivers = [ "nvidiaLegacy304" ];
|
||||
You may need to reboot after enabling this driver to prevent a clash
|
||||
with other kernel modules.
|
||||
|
||||
## Proprietary AMD drivers {#sec-x11--graphics-cards-amd .unnumbered}
|
||||
## Proprietary AMD drivers {#sec-x11--graphics-cards-amd}
|
||||
|
||||
AMD provides a proprietary driver for its graphics cards that is not
|
||||
enabled by default because it's not Free Software, is often broken in
|
||||
@@ -173,7 +173,7 @@ services.xserver.videoDrivers = [ "amdgpu-pro" ];
|
||||
You will need to reboot after enabling this driver to prevent a clash
|
||||
with other kernel modules.
|
||||
|
||||
## Touchpads {#sec-x11-touchpads .unnumbered}
|
||||
## Touchpads {#sec-x11-touchpads}
|
||||
|
||||
Support for Synaptics touchpads (found in many laptops such as the Dell
|
||||
Latitude series) can be enabled as follows:
|
||||
@@ -192,7 +192,7 @@ services.xserver.libinput.touchpad.tapping = false;
|
||||
Note: the use of `services.xserver.synaptics` is deprecated since NixOS
|
||||
17.09.
|
||||
|
||||
## GTK/Qt themes {#sec-x11-gtk-and-qt-themes .unnumbered}
|
||||
## GTK/Qt themes {#sec-x11-gtk-and-qt-themes}
|
||||
|
||||
GTK themes can be installed either to user profile or system-wide (via
|
||||
`environment.systemPackages`). To make Qt 5 applications look similar to
|
||||
@@ -204,7 +204,7 @@ qt.platformTheme = "gtk2";
|
||||
qt.style = "gtk2";
|
||||
```
|
||||
|
||||
## Custom XKB layouts {#custom-xkb-layouts .unnumbered}
|
||||
## Custom XKB layouts {#custom-xkb-layouts}
|
||||
|
||||
It is possible to install custom [ XKB
|
||||
](https://en.wikipedia.org/wiki/X_keyboard_extension) keyboard layouts
|
||||
|
||||
@@ -24,7 +24,7 @@ Some Xfce programs are not installed automatically. To install them
|
||||
manually (system wide), put them into your
|
||||
[](#opt-environment.systemPackages) from `pkgs.xfce`.
|
||||
|
||||
## Thunar {#sec-xfce-thunar-plugins .unnumbered}
|
||||
## Thunar {#sec-xfce-thunar-plugins}
|
||||
|
||||
Thunar (the Xfce file manager) is automatically enabled when Xfce is
|
||||
enabled. To enable Thunar without enabling Xfce, use the configuration
|
||||
@@ -35,7 +35,7 @@ If you'd like to add extra plugins to Thunar, add them to
|
||||
[](#opt-programs.thunar.plugins). You shouldn't just add them to
|
||||
[](#opt-environment.systemPackages).
|
||||
|
||||
## Troubleshooting {#sec-xfce-troubleshooting .unnumbered}
|
||||
## Troubleshooting {#sec-xfce-troubleshooting}
|
||||
|
||||
Even after enabling udisks2, volume management might not work. Thunar
|
||||
and/or the desktop takes time to show up. Thunar will spit out this kind
|
||||
@@ -54,4 +54,4 @@ run this command to do the same thing.
|
||||
$ xfconf-query -c xfce4-session -p /compat/LaunchGNOME -s true
|
||||
```
|
||||
|
||||
A log-out and re-log will be needed for this to take effect.
|
||||
It is necessary to log out and log in again for this to take effect.
|
||||
|
||||
@@ -6,7 +6,6 @@ You can quickly check your edits with the following:
|
||||
|
||||
```ShellSession
|
||||
$ cd /path/to/nixpkgs
|
||||
$ ./nixos/doc/manual/md-to-db.sh
|
||||
$ nix-build nixos/release.nix -A manual.x86_64-linux
|
||||
```
|
||||
|
||||
|
||||
+104
-87
@@ -21,6 +21,8 @@ let
|
||||
withManOptDedupPatch = true;
|
||||
};
|
||||
|
||||
manpageUrls = pkgs.path + "/doc/manpage-urls.json";
|
||||
|
||||
# We need to strip references to /nix/store/* from options,
|
||||
# including any `extraSources` if some modules came from elsewhere,
|
||||
# or else the build will fail.
|
||||
@@ -48,7 +50,7 @@ let
|
||||
};
|
||||
in buildPackages.nixosOptionsDoc {
|
||||
inherit (eval) options;
|
||||
inherit (revision);
|
||||
inherit revision;
|
||||
transformOptions = opt: opt // {
|
||||
# Clean up declaration sites to not refer to the NixOS source tree.
|
||||
declarations =
|
||||
@@ -66,34 +68,6 @@ let
|
||||
optionIdPrefix = "test-opt-";
|
||||
};
|
||||
|
||||
sources = lib.sourceFilesBySuffices ./. [".xml"];
|
||||
|
||||
modulesDoc = runCommand "modules.xml" {
|
||||
nativeBuildInputs = [ pkgs.nixos-render-docs ];
|
||||
} ''
|
||||
nixos-render-docs manual docbook \
|
||||
--manpage-urls ${pkgs.path + "/doc/manpage-urls.json"} \
|
||||
"$out" \
|
||||
--section \
|
||||
--section-id modules \
|
||||
--chapters ${lib.concatMapStrings (p: "${p.value} ") config.meta.doc}
|
||||
'';
|
||||
|
||||
generatedSources = runCommand "generated-docbook" {} ''
|
||||
mkdir $out
|
||||
ln -s ${modulesDoc} $out/modules.xml
|
||||
ln -s ${optionsDoc.optionsDocBook} $out/options-db.xml
|
||||
ln -s ${testOptionsDoc.optionsDocBook} $out/test-options-db.xml
|
||||
printf "%s" "${version}" > $out/version
|
||||
'';
|
||||
|
||||
copySources =
|
||||
''
|
||||
cp -prd $sources/* . # */
|
||||
ln -s ${generatedSources} ./generated
|
||||
chmod -R u+w .
|
||||
'';
|
||||
|
||||
toc = builtins.toFile "toc.xml"
|
||||
''
|
||||
<toc role="chunk-toc">
|
||||
@@ -124,70 +98,102 @@ let
|
||||
"--stringparam chunk.toc ${toc}"
|
||||
];
|
||||
|
||||
linterFunctions = ''
|
||||
# outputs the context of an xmllint error output
|
||||
# LEN lines around the failing line are printed
|
||||
function context {
|
||||
# length of context
|
||||
local LEN=6
|
||||
# lines to print before error line
|
||||
local BEFORE=4
|
||||
|
||||
# xmllint output lines are:
|
||||
# file.xml:1234: there was an error on line 1234
|
||||
while IFS=':' read -r file line rest; do
|
||||
echo
|
||||
if [[ -n "$rest" ]]; then
|
||||
echo "$file:$line:$rest"
|
||||
local FROM=$(($line>$BEFORE ? $line - $BEFORE : 1))
|
||||
# number lines & filter context
|
||||
nl --body-numbering=a "$file" | sed -n "$FROM,+$LEN p"
|
||||
else
|
||||
if [[ -n "$line" ]]; then
|
||||
echo "$file:$line"
|
||||
else
|
||||
echo "$file"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function lintrng {
|
||||
xmllint --debug --noout --nonet \
|
||||
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
|
||||
"$1" \
|
||||
2>&1 | context 1>&2
|
||||
# ^ redirect assumes xmllint doesn’t print to stdout
|
||||
}
|
||||
'';
|
||||
|
||||
manual-combined = runCommand "nixos-manual-combined"
|
||||
{ inherit sources;
|
||||
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
|
||||
{ inputs = lib.sourceFilesBySuffices ./. [ ".xml" ".md" ];
|
||||
nativeBuildInputs = [ pkgs.nixos-render-docs pkgs.libxml2.bin pkgs.libxslt.bin ];
|
||||
meta.description = "The NixOS manual as plain docbook XML";
|
||||
}
|
||||
''
|
||||
${copySources}
|
||||
cp -r --no-preserve=all $inputs/* .
|
||||
|
||||
xmllint --xinclude --output ./manual-combined.xml ./manual.xml
|
||||
xmllint --xinclude --noxincludenode \
|
||||
--output ./man-pages-combined.xml ./man-pages.xml
|
||||
substituteInPlace ./manual.md \
|
||||
--replace '@NIXOS_VERSION@' "${version}"
|
||||
substituteInPlace ./configuration/configuration.md \
|
||||
--replace \
|
||||
'@MODULE_CHAPTERS@' \
|
||||
${lib.escapeShellArg (lib.concatMapStringsSep "\n" (p: "${p.value}") config.meta.doc)}
|
||||
substituteInPlace ./nixos-options.md \
|
||||
--replace \
|
||||
'@NIXOS_OPTIONS_JSON@' \
|
||||
${optionsDoc.optionsJSON}/share/doc/nixos/options.json
|
||||
substituteInPlace ./development/writing-nixos-tests.section.md \
|
||||
--replace \
|
||||
'@NIXOS_TEST_OPTIONS_JSON@' \
|
||||
${testOptionsDoc.optionsJSON}/share/doc/nixos/options.json
|
||||
|
||||
# outputs the context of an xmllint error output
|
||||
# LEN lines around the failing line are printed
|
||||
function context {
|
||||
# length of context
|
||||
local LEN=6
|
||||
# lines to print before error line
|
||||
local BEFORE=4
|
||||
nixos-render-docs -j $NIX_BUILD_CORES manual docbook \
|
||||
--manpage-urls ${manpageUrls} \
|
||||
--revision ${lib.escapeShellArg revision} \
|
||||
./manual.md \
|
||||
./manual-combined.xml
|
||||
|
||||
# xmllint output lines are:
|
||||
# file.xml:1234: there was an error on line 1234
|
||||
while IFS=':' read -r file line rest; do
|
||||
echo
|
||||
if [[ -n "$rest" ]]; then
|
||||
echo "$file:$line:$rest"
|
||||
local FROM=$(($line>$BEFORE ? $line - $BEFORE : 1))
|
||||
# number lines & filter context
|
||||
nl --body-numbering=a "$file" | sed -n "$FROM,+$LEN p"
|
||||
else
|
||||
if [[ -n "$line" ]]; then
|
||||
echo "$file:$line"
|
||||
else
|
||||
echo "$file"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function lintrng {
|
||||
xmllint --debug --noout --nonet \
|
||||
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
|
||||
"$1" \
|
||||
2>&1 | context 1>&2
|
||||
# ^ redirect assumes xmllint doesn’t print to stdout
|
||||
}
|
||||
${linterFunctions}
|
||||
|
||||
mkdir $out
|
||||
cp manual-combined.xml $out/
|
||||
cp man-pages-combined.xml $out/
|
||||
|
||||
lintrng $out/manual-combined.xml
|
||||
lintrng $out/man-pages-combined.xml
|
||||
'';
|
||||
|
||||
manpages-combined = runCommand "nixos-manpages-combined.xml"
|
||||
{ nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
|
||||
meta.description = "The NixOS manpages as plain docbook XML";
|
||||
}
|
||||
''
|
||||
mkdir generated
|
||||
cp -prd ${./man-pages.xml} man-pages.xml
|
||||
ln -s ${optionsDoc.optionsDocBook} generated/options-db.xml
|
||||
|
||||
xmllint --xinclude --noxincludenode --output $out ./man-pages.xml
|
||||
|
||||
${linterFunctions}
|
||||
|
||||
lintrng $out
|
||||
'';
|
||||
|
||||
in rec {
|
||||
inherit generatedSources;
|
||||
|
||||
inherit (optionsDoc) optionsJSON optionsNix optionsDocBook optionsUsedDocbook;
|
||||
|
||||
# Generate the NixOS manual.
|
||||
manualHTML = runCommand "nixos-manual-html"
|
||||
{ inherit sources;
|
||||
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
|
||||
{ nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
|
||||
meta.description = "The NixOS manual in HTML format";
|
||||
allowedReferences = ["out"];
|
||||
}
|
||||
@@ -224,8 +230,7 @@ in rec {
|
||||
manualHTMLIndex = "${manualHTML}/share/doc/nixos/index.html";
|
||||
|
||||
manualEpub = runCommand "nixos-manual-epub"
|
||||
{ inherit sources;
|
||||
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin buildPackages.zip ];
|
||||
{ nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin buildPackages.zip ];
|
||||
}
|
||||
''
|
||||
# Generate the epub manual.
|
||||
@@ -253,11 +258,13 @@ in rec {
|
||||
|
||||
# Generate the NixOS manpages.
|
||||
manpages = runCommand "nixos-manpages"
|
||||
{ inherit sources;
|
||||
nativeBuildInputs = [
|
||||
{ nativeBuildInputs = [
|
||||
buildPackages.installShellFiles
|
||||
] ++ lib.optionals allowDocBook [
|
||||
buildPackages.libxml2.bin
|
||||
buildPackages.libxslt.bin
|
||||
buildPackages.installShellFiles
|
||||
] ++ lib.optionals (! allowDocBook) [
|
||||
buildPackages.nixos-render-docs
|
||||
];
|
||||
allowedReferences = ["out"];
|
||||
}
|
||||
@@ -265,14 +272,24 @@ in rec {
|
||||
# Generate manpages.
|
||||
mkdir -p $out/share/man/man8
|
||||
installManPage ${./manpages}/*
|
||||
xsltproc --nonet \
|
||||
--maxdepth 6000 \
|
||||
--param man.output.in.separate.dir 1 \
|
||||
--param man.output.base.dir "'$out/share/man/'" \
|
||||
--param man.endnotes.are.numbered 0 \
|
||||
--param man.break.after.slash 1 \
|
||||
${docbook_xsl_ns}/xml/xsl/docbook/manpages/docbook.xsl \
|
||||
${manual-combined}/man-pages-combined.xml
|
||||
${if allowDocBook
|
||||
then ''
|
||||
xsltproc --nonet \
|
||||
--maxdepth 6000 \
|
||||
--param man.output.in.separate.dir 1 \
|
||||
--param man.output.base.dir "'$out/share/man/'" \
|
||||
--param man.endnotes.are.numbered 0 \
|
||||
--param man.break.after.slash 1 \
|
||||
${docbook_xsl_ns}/xml/xsl/docbook/manpages/docbook.xsl \
|
||||
${manpages-combined}
|
||||
''
|
||||
else ''
|
||||
mkdir -p $out/share/man/man5
|
||||
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
|
||||
--revision ${lib.escapeShellArg revision} \
|
||||
${optionsJSON}/share/doc/nixos/options.json \
|
||||
$out/share/man/man5/configuration.nix.5
|
||||
''}
|
||||
'';
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
# Developing the NixOS Test Driver {#chap-developing-the-test-driver}
|
||||
|
||||
The NixOS test framework is a project of its own.
|
||||
|
||||
It consists of roughly the following components:
|
||||
|
||||
- `nixos/lib/test-driver`: The Python framework that sets up the test and runs the [`testScript`](#test-opt-testScript)
|
||||
- `nixos/lib/testing`: The Nix code responsible for the wiring, written using the (NixOS) Module System.
|
||||
|
||||
These components are exposed publicly through:
|
||||
|
||||
- `nixos/lib/default.nix`: The public interface that exposes the `nixos/lib/testing` entrypoint.
|
||||
- `flake.nix`: Exposes the `lib.nixos`, including the public test interface.
|
||||
|
||||
Beyond the test driver itself, its integration into NixOS and Nixpkgs is important.
|
||||
|
||||
- `pkgs/top-level/all-packages.nix`: Defines the `nixosTests` attribute, used
|
||||
by the package `tests` attributes and OfBorg.
|
||||
- `nixos/release.nix`: Defines the `tests` attribute built by Hydra, independently, but analogous to `nixosTests`
|
||||
- `nixos/release-combined.nix`: Defines which tests are channel blockers.
|
||||
|
||||
Finally, we have legacy entrypoints that users should move away from, but are cared for on a best effort basis.
|
||||
These include `pkgs.nixosTest`, `testing-python.nix` and `make-test-python.nix`.
|
||||
|
||||
## Testing changes to the test framework {#sec-test-the-test-framework}
|
||||
|
||||
When making significant changes to the test framework, we run the tests on Hydra, to avoid disrupting the larger NixOS project.
|
||||
|
||||
For this, we use the `python-test-refactoring` branch in the `NixOS/nixpkgs` repository, and its [corresponding Hydra jobset](https://hydra.nixos.org/jobset/nixos/python-test-refactoring).
|
||||
This branch is used as a pointer, and not as a feature branch.
|
||||
|
||||
1. Rebase the PR onto a recent, good evaluation of `nixos-unstable`
|
||||
2. Create a baseline evaluation by force-pushing this revision of `nixos-unstable` to `python-test-refactoring`.
|
||||
3. Note the evaluation number (we'll call it `<previous>`)
|
||||
4. Push the PR to `python-test-refactoring` and evaluate the PR on Hydra
|
||||
5. Create a comparison URL by navigating to the latest build of the PR and adding to the URL `?compare=<previous>`. This is not necessary for the evaluation that comes right after the baseline.
|
||||
|
||||
Review the removed tests and newly failed tests using the constructed URL; otherwise you will accidentally compare iterations of the PR instead of changes to the PR base.
|
||||
|
||||
As we currently have some flaky tests, newly failing tests are expected, but should be reviewed to make sure that
|
||||
- The number of failures did not increase significantly.
|
||||
- All failures that do occur can reasonably be assumed to fail for a different reason than the changes.
|
||||
@@ -0,0 +1,15 @@
|
||||
# Development {#ch-development}
|
||||
|
||||
This chapter describes how you can modify and extend NixOS.
|
||||
|
||||
```{=include=} chapters
|
||||
sources.chapter.md
|
||||
writing-modules.chapter.md
|
||||
building-parts.chapter.md
|
||||
bootspec.chapter.md
|
||||
what-happens-during-a-system-switch.chapter.md
|
||||
writing-documentation.chapter.md
|
||||
nixos-tests.chapter.md
|
||||
developing-the-test-driver.chapter.md
|
||||
testing-installer.chapter.md
|
||||
```
|
||||
@@ -1,20 +0,0 @@
|
||||
<part xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
version="5.0"
|
||||
xml:id="ch-development">
|
||||
<title>Development</title>
|
||||
<partintro xml:id="ch-development-intro">
|
||||
<para>
|
||||
This chapter describes how you can modify and extend NixOS.
|
||||
</para>
|
||||
</partintro>
|
||||
<xi:include href="../from_md/development/sources.chapter.xml" />
|
||||
<xi:include href="../from_md/development/writing-modules.chapter.xml" />
|
||||
<xi:include href="../from_md/development/building-parts.chapter.xml" />
|
||||
<xi:include href="../from_md/development/bootspec.chapter.xml" />
|
||||
<xi:include href="../from_md/development/what-happens-during-a-system-switch.chapter.xml" />
|
||||
<xi:include href="../from_md/development/writing-documentation.chapter.xml" />
|
||||
<xi:include href="../from_md/development/nixos-tests.chapter.xml" />
|
||||
<xi:include href="../from_md/development/testing-installer.chapter.xml" />
|
||||
</part>
|
||||
@@ -13,9 +13,8 @@ checking for entire option trees, it is only recommended for use in
|
||||
submodules.
|
||||
|
||||
::: {#ex-freeform-module .example}
|
||||
::: {.title}
|
||||
**Example: Freeform submodule**
|
||||
:::
|
||||
|
||||
The following shows a submodule assigning a freeform type that allows
|
||||
arbitrary attributes with `str` values below `settings`, but also
|
||||
declares an option for the `settings.port` attribute to have it
|
||||
|
||||
@@ -5,9 +5,9 @@ NixOS tests are kept in the directory `nixos/tests`, and are executed
|
||||
(using Nix) by a testing framework that automatically starts one or more
|
||||
virtual machines containing the NixOS system(s) required for the test.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="writing-nixos-tests.section.xml" />
|
||||
<xi:include href="running-nixos-tests.section.xml" />
|
||||
<xi:include href="running-nixos-tests-interactively.section.xml" />
|
||||
<xi:include href="linking-nixos-tests-to-packages.section.xml" />
|
||||
```{=include=} sections
|
||||
writing-nixos-tests.section.md
|
||||
running-nixos-tests.section.md
|
||||
running-nixos-tests-interactively.section.md
|
||||
linking-nixos-tests-to-packages.section.md
|
||||
```
|
||||
|
||||
@@ -87,6 +87,7 @@ lib.mkOption {
|
||||
description = lib.mdDoc "Whether to enable magic.";
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
### `mkPackageOption`, `mkPackageOptionMD` {#sec-option-declarations-util-mkPackageOption}
|
||||
|
||||
@@ -108,7 +109,7 @@ You can omit the default path if the name of the option is also attribute path i
|
||||
|
||||
During the transition to CommonMark documentation `mkPackageOption` creates an option with a DocBook description attribute, once the transition is completed it will create a CommonMark description instead. `mkPackageOptionMD` always creates an option with a CommonMark description attribute and will be removed some time after the transition is completed.
|
||||
|
||||
::: {#ex-options-declarations-util-mkPackageOption .title}
|
||||
[]{#ex-options-declarations-util-mkPackageOption}
|
||||
Examples:
|
||||
|
||||
::: {#ex-options-declarations-util-mkPackageOption-hello .example}
|
||||
@@ -122,6 +123,7 @@ lib.mkOption {
|
||||
description = lib.mdDoc "The hello package to use.";
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
::: {#ex-options-declarations-util-mkPackageOption-ghc .example}
|
||||
```nix
|
||||
@@ -138,6 +140,7 @@ lib.mkOption {
|
||||
description = lib.mdDoc "The GHC package to use.";
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
## Extensible Option Types {#sec-option-declarations-eot}
|
||||
|
||||
@@ -186,9 +189,7 @@ changing the main service module file and the type system automatically
|
||||
enforces that there can only be a single display manager enabled.
|
||||
|
||||
::: {#ex-option-declaration-eot-service .example}
|
||||
::: {.title}
|
||||
**Example: Extensible type placeholder in the service module**
|
||||
:::
|
||||
```nix
|
||||
services.xserver.displayManager.enable = mkOption {
|
||||
description = "Display manager to use";
|
||||
@@ -198,9 +199,7 @@ services.xserver.displayManager.enable = mkOption {
|
||||
:::
|
||||
|
||||
::: {#ex-option-declaration-eot-backend-gdm .example}
|
||||
::: {.title}
|
||||
**Example: Extending `services.xserver.displayManager.enable` in the `gdm` module**
|
||||
:::
|
||||
```nix
|
||||
services.xserver.displayManager.enable = mkOption {
|
||||
type = with types; nullOr (enum [ "gdm" ]);
|
||||
@@ -209,9 +208,7 @@ services.xserver.displayManager.enable = mkOption {
|
||||
:::
|
||||
|
||||
::: {#ex-option-declaration-eot-backend-sddm .example}
|
||||
::: {.title}
|
||||
**Example: Extending `services.xserver.displayManager.enable` in the `sddm` module**
|
||||
:::
|
||||
```nix
|
||||
services.xserver.displayManager.enable = mkOption {
|
||||
type = with types; nullOr (enum [ "sddm" ]);
|
||||
|
||||
@@ -12,7 +12,7 @@ config = {
|
||||
However, sometimes you need to wrap an option definition or set of
|
||||
option definitions in a *property* to achieve certain effects:
|
||||
|
||||
## Delaying Conditionals {#sec-option-definitions-delaying-conditionals .unnumbered}
|
||||
## Delaying Conditionals {#sec-option-definitions-delaying-conditionals}
|
||||
|
||||
If a set of option definitions is conditional on the value of another
|
||||
option, you may need to use `mkIf`. Consider, for instance:
|
||||
@@ -56,7 +56,7 @@ config = {
|
||||
};
|
||||
```
|
||||
|
||||
## Setting Priorities {#sec-option-definitions-setting-priorities .unnumbered}
|
||||
## Setting Priorities {#sec-option-definitions-setting-priorities}
|
||||
|
||||
A module can override the definitions of an option in other modules by
|
||||
setting an *override priority*. All option definitions that do not have the lowest
|
||||
@@ -72,7 +72,7 @@ This definition causes all other definitions with priorities above 10 to
|
||||
be discarded. The function `mkForce` is equal to `mkOverride 50`, and
|
||||
`mkDefault` is equal to `mkOverride 1000`.
|
||||
|
||||
## Ordering Definitions {#sec-option-definitions-ordering .unnumbered}
|
||||
## Ordering Definitions {#sec-option-definitions-ordering}
|
||||
|
||||
It is also possible to influence the order in which the definitions for an option are
|
||||
merged by setting an *order priority* with `mkOrder`. The default order priority is 1000.
|
||||
@@ -89,7 +89,7 @@ definitions in the final list value of `hardware.firmware`.
|
||||
Note that this is different from [override priorities](#sec-option-definitions-setting-priorities):
|
||||
setting an order does not affect whether the definition is included or not.
|
||||
|
||||
## Merging Configurations {#sec-option-definitions-merging .unnumbered}
|
||||
## Merging Configurations {#sec-option-definitions-merging}
|
||||
|
||||
In conjunction with `mkIf`, it is sometimes useful for a module to
|
||||
return multiple sets of option definitions, to be merged together as if
|
||||
|
||||
@@ -36,9 +36,8 @@ merging is handled.
|
||||
together. This type is recommended when the option type is unknown.
|
||||
|
||||
::: {#ex-types-anything .example}
|
||||
::: {.title}
|
||||
**Example: `types.anything` Example**
|
||||
:::
|
||||
|
||||
Two definitions of this type like
|
||||
|
||||
```nix
|
||||
@@ -357,9 +356,7 @@ you will still need to provide a default value (e.g. an empty attribute set)
|
||||
if you want to allow users to leave it undefined.
|
||||
|
||||
::: {#ex-submodule-direct .example}
|
||||
::: {.title}
|
||||
**Example: Directly defined submodule**
|
||||
:::
|
||||
```nix
|
||||
options.mod = mkOption {
|
||||
description = "submodule example";
|
||||
@@ -378,9 +375,7 @@ options.mod = mkOption {
|
||||
:::
|
||||
|
||||
::: {#ex-submodule-reference .example}
|
||||
::: {.title}
|
||||
**Example: Submodule defined as a reference**
|
||||
:::
|
||||
```nix
|
||||
let
|
||||
modOptions = {
|
||||
@@ -408,9 +403,7 @@ multiple definitions of the submodule option set
|
||||
([Example: Definition of a list of submodules](#ex-submodule-listof-definition)).
|
||||
|
||||
::: {#ex-submodule-listof-declaration .example}
|
||||
::: {.title}
|
||||
**Example: Declaration of a list of submodules**
|
||||
:::
|
||||
```nix
|
||||
options.mod = mkOption {
|
||||
description = "submodule example";
|
||||
@@ -429,9 +422,7 @@ options.mod = mkOption {
|
||||
:::
|
||||
|
||||
::: {#ex-submodule-listof-definition .example}
|
||||
::: {.title}
|
||||
**Example: Definition of a list of submodules**
|
||||
:::
|
||||
```nix
|
||||
config.mod = [
|
||||
{ foo = 1; bar = "one"; }
|
||||
@@ -446,9 +437,7 @@ multiple named definitions of the submodule option set
|
||||
([Example: Definition of attribute sets of submodules](#ex-submodule-attrsof-definition)).
|
||||
|
||||
::: {#ex-submodule-attrsof-declaration .example}
|
||||
::: {.title}
|
||||
**Example: Declaration of attribute sets of submodules**
|
||||
:::
|
||||
```nix
|
||||
options.mod = mkOption {
|
||||
description = "submodule example";
|
||||
@@ -467,9 +456,7 @@ options.mod = mkOption {
|
||||
:::
|
||||
|
||||
::: {#ex-submodule-attrsof-definition .example}
|
||||
::: {.title}
|
||||
**Example: Definition of attribute sets of submodules**
|
||||
:::
|
||||
```nix
|
||||
config.mod.one = { foo = 1; bar = "one"; };
|
||||
config.mod.two = { foo = 2; bar = "two"; };
|
||||
@@ -489,9 +476,8 @@ Types are mainly characterized by their `check` and `merge` functions.
|
||||
([Example: Overriding a type check](#ex-extending-type-check-2)).
|
||||
|
||||
::: {#ex-extending-type-check-1 .example}
|
||||
::: {.title}
|
||||
**Example: Adding a type check**
|
||||
:::
|
||||
|
||||
```nix
|
||||
byte = mkOption {
|
||||
description = "An integer between 0 and 255.";
|
||||
@@ -501,9 +487,8 @@ Types are mainly characterized by their `check` and `merge` functions.
|
||||
:::
|
||||
|
||||
::: {#ex-extending-type-check-2 .example}
|
||||
::: {.title}
|
||||
**Example: Overriding a type check**
|
||||
:::
|
||||
|
||||
```nix
|
||||
nixThings = mkOption {
|
||||
description = "words that start with 'nix'";
|
||||
|
||||
@@ -119,9 +119,8 @@ have a predefined type and string generator already declared under
|
||||
default Elixir keyword list
|
||||
|
||||
|
||||
::: {#pkgs-formats-result}
|
||||
[]{#pkgs-formats-result}
|
||||
These functions all return an attribute set with these values:
|
||||
:::
|
||||
|
||||
`type`
|
||||
|
||||
@@ -144,9 +143,8 @@ These functions all return an attribute set with these values:
|
||||
:::
|
||||
|
||||
::: {#ex-settings-nix-representable .example}
|
||||
::: {.title}
|
||||
**Example: Module with conventional `settings` option**
|
||||
:::
|
||||
|
||||
The following shows a module for an example program that uses a JSON
|
||||
configuration file. It demonstrates how above values can be used, along
|
||||
with some other related best practices. See the comments for
|
||||
@@ -220,9 +218,7 @@ the port, which will enforce it to be a valid integer and make it show
|
||||
up in the manual.
|
||||
|
||||
::: {#ex-settings-typed-attrs .example}
|
||||
::: {.title}
|
||||
**Example: Declaring a type-checked `settings` attribute**
|
||||
:::
|
||||
```nix
|
||||
settings = lib.mkOption {
|
||||
type = lib.types.submodule {
|
||||
|
||||
@@ -47,7 +47,7 @@ Most of these actions are either self-explaining but some of them have to do
|
||||
with our units or the activation script. For this reason, these topics are
|
||||
explained in the next sections.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="unit-handling.section.xml" />
|
||||
<xi:include href="activation-script.section.xml" />
|
||||
```{=include=} sections
|
||||
unit-handling.section.md
|
||||
activation-script.section.md
|
||||
```
|
||||
|
||||
@@ -83,7 +83,7 @@ Keep the following guidelines in mind when you create and add a topic:
|
||||
|
||||
## Adding a Topic to the Book {#sec-writing-docs-adding-a-topic}
|
||||
|
||||
Open the parent XML file and add an `xi:include` element to the list of
|
||||
Open the parent CommonMark file and add a line to the list of
|
||||
chapters with the file name of the topic that you created. If you
|
||||
created a `section`, you add the file to the `chapter` file. If you created
|
||||
a `chapter`, you add the file to the `part` file.
|
||||
|
||||
@@ -37,9 +37,7 @@ options, but does not declare any. The structure of full NixOS modules
|
||||
is shown in [Example: Structure of NixOS Modules](#ex-module-syntax).
|
||||
|
||||
::: {#ex-module-syntax .example}
|
||||
::: {.title}
|
||||
**Example: Structure of NixOS Modules**
|
||||
:::
|
||||
```nix
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
@@ -102,9 +100,7 @@ Exec directives](#exec-escaping-example) for an example. When using these
|
||||
functions system environment substitution should *not* be disabled explicitly.
|
||||
|
||||
::: {#locate-example .example}
|
||||
::: {.title}
|
||||
**Example: NixOS Module for the "locate" Service**
|
||||
:::
|
||||
```nix
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
@@ -165,9 +161,7 @@ in {
|
||||
:::
|
||||
|
||||
::: {#exec-escaping-example .example}
|
||||
::: {.title}
|
||||
**Example: Escaping in Exec directives**
|
||||
:::
|
||||
```nix
|
||||
{ config, lib, pkgs, utils, ... }:
|
||||
|
||||
@@ -195,14 +189,14 @@ in {
|
||||
```
|
||||
:::
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="option-declarations.section.xml" />
|
||||
<xi:include href="option-types.section.xml" />
|
||||
<xi:include href="option-def.section.xml" />
|
||||
<xi:include href="assertions.section.xml" />
|
||||
<xi:include href="meta-attributes.section.xml" />
|
||||
<xi:include href="importing-modules.section.xml" />
|
||||
<xi:include href="replace-modules.section.xml" />
|
||||
<xi:include href="freeform-modules.section.xml" />
|
||||
<xi:include href="settings-options.section.xml" />
|
||||
```{=include=} sections
|
||||
option-declarations.section.md
|
||||
option-types.section.md
|
||||
option-def.section.md
|
||||
assertions.section.md
|
||||
meta-attributes.section.md
|
||||
importing-modules.section.md
|
||||
replace-modules.section.md
|
||||
freeform-modules.section.md
|
||||
settings-options.section.md
|
||||
```
|
||||
|
||||
@@ -417,8 +417,7 @@ with foo_running:
|
||||
|
||||
`seconds_interval`
|
||||
|
||||
:
|
||||
specifies how often the condition should be polled:
|
||||
: specifies how often the condition should be polled:
|
||||
|
||||
```py
|
||||
@polling_condition(seconds_interval=10)
|
||||
@@ -428,8 +427,7 @@ def foo_running():
|
||||
|
||||
`description`
|
||||
|
||||
:
|
||||
is used in the log when the condition is checked. If this is not provided, the description is pulled from the docstring of the function. These two are therefore equivalent:
|
||||
: is used in the log when the condition is checked. If this is not provided, the description is pulled from the docstring of the function. These two are therefore equivalent:
|
||||
|
||||
```py
|
||||
@polling_condition
|
||||
@@ -472,6 +470,8 @@ In that case, `numpy` is chosen from the generic `python3Packages`.
|
||||
|
||||
The following options can be used when writing tests.
|
||||
|
||||
```{=docbook}
|
||||
<xi:include href="../../generated/test-options-db.xml" xpointer="test-options-list"/>
|
||||
```{=include=} options
|
||||
id-prefix: test-opt-
|
||||
list-id: test-options-list
|
||||
source: @NIXOS_TEST_OPTIONS_JSON@
|
||||
```
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
This directory is temporarily needed while we transition the manual to CommonMark. It stores the output of the ../md-to-db.sh script that converts CommonMark files back to DocBook.
|
||||
|
||||
We are choosing to convert the Markdown to DocBook at authoring time instead of manual building time, because we do not want the pandoc toolchain to become part of the NixOS closure.
|
||||
|
||||
Do not edit the DocBook files inside this directory or its subdirectories. Instead, edit the corresponding .md file in the normal manual directories, and run ../md-to-db.sh to update the file here.
|
||||
@@ -1,144 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-boot-problems">
|
||||
<title>Boot Problems</title>
|
||||
<para>
|
||||
If NixOS fails to boot, there are a number of kernel command line
|
||||
parameters that may help you to identify or fix the issue. You can
|
||||
add these parameters in the GRUB boot menu by pressing “e” to modify
|
||||
the selected boot entry and editing the line starting with
|
||||
<literal>linux</literal>. The following are some useful kernel
|
||||
command line parameters that are recognised by the NixOS boot
|
||||
scripts or by systemd:
|
||||
</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>boot.shell_on_fail</literal>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allows the user to start a root shell if something goes wrong
|
||||
in stage 1 of the boot process (the initial ramdisk). This is
|
||||
disabled by default because there is no authentication for the
|
||||
root shell.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>boot.debug1</literal>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Start an interactive shell in stage 1 before anything useful
|
||||
has been done. That is, no modules have been loaded and no
|
||||
file systems have been mounted, except for
|
||||
<literal>/proc</literal> and <literal>/sys</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>boot.debug1devices</literal>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Like <literal>boot.debug1</literal>, but runs stage1 until
|
||||
kernel modules are loaded and device nodes are created. This
|
||||
may help with e.g. making the keyboard work.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>boot.debug1mounts</literal>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Like <literal>boot.debug1</literal> or
|
||||
<literal>boot.debug1devices</literal>, but runs stage1 until
|
||||
all filesystems that are mounted during initrd are mounted
|
||||
(see
|
||||
<link linkend="opt-fileSystems._name_.neededForBoot">neededForBoot</link>).
|
||||
As a motivating example, this could be useful if you’ve
|
||||
forgotten to set
|
||||
<link linkend="opt-fileSystems._name_.neededForBoot">neededForBoot</link>
|
||||
on a file system.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>boot.trace</literal>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Print every shell command executed by the stage 1 and 2 boot
|
||||
scripts.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>single</literal>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Boot into rescue mode (a.k.a. single user mode). This will
|
||||
cause systemd to start nothing but the unit
|
||||
<literal>rescue.target</literal>, which runs
|
||||
<literal>sulogin</literal> to prompt for the root password and
|
||||
start a root login shell. Exiting the shell causes the system
|
||||
to continue with the normal boot process.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>systemd.log_level=debug</literal>
|
||||
<literal>systemd.log_target=console</literal>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Make systemd very verbose and send log messages to the console
|
||||
instead of the journal. For more parameters recognised by
|
||||
systemd, see systemd(1).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<para>
|
||||
In addition, these arguments are recognised by the live image only:
|
||||
</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>live.nixos.passwd=password</literal>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Set the password for the <literal>nixos</literal> live user.
|
||||
This can be used for SSH access if there are issues using the
|
||||
terminal.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<para>
|
||||
Notice that for <literal>boot.shell_on_fail</literal>,
|
||||
<literal>boot.debug1</literal>,
|
||||
<literal>boot.debug1devices</literal>, and
|
||||
<literal>boot.debug1mounts</literal>, if you did
|
||||
<emphasis role="strong">not</emphasis> select <quote>start the new
|
||||
shell as pid 1</quote>, and you <literal>exit</literal> from the new
|
||||
shell, boot will proceed normally from the point where it failed, as
|
||||
if you’d chosen <quote>ignore the error and continue</quote>.
|
||||
</para>
|
||||
<para>
|
||||
If no login prompts or X11 login screens appear (e.g. due to hanging
|
||||
dependencies), you can press Alt+ArrowUp. If you’re lucky, this will
|
||||
start rescue mode (described above). (Also note that since most
|
||||
units have a 90-second timeout before systemd gives up on them, the
|
||||
<literal>agetty</literal> login prompts should appear eventually
|
||||
unless something is very wrong.)
|
||||
</para>
|
||||
</section>
|
||||
@@ -1,72 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-nix-gc">
|
||||
<title>Cleaning the Nix Store</title>
|
||||
<para>
|
||||
Nix has a purely functional model, meaning that packages are never
|
||||
upgraded in place. Instead new versions of packages end up in a
|
||||
different location in the Nix store (<literal>/nix/store</literal>).
|
||||
You should periodically run Nix’s <emphasis>garbage
|
||||
collector</emphasis> to remove old, unreferenced packages. This is
|
||||
easy:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-collect-garbage
|
||||
</programlisting>
|
||||
<para>
|
||||
Alternatively, you can use a systemd unit that does the same in the
|
||||
background:
|
||||
</para>
|
||||
<programlisting>
|
||||
# systemctl start nix-gc.service
|
||||
</programlisting>
|
||||
<para>
|
||||
You can tell NixOS in <literal>configuration.nix</literal> to run
|
||||
this unit automatically at certain points in time, for instance,
|
||||
every night at 03:15:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
nix.gc.automatic = true;
|
||||
nix.gc.dates = "03:15";
|
||||
</programlisting>
|
||||
<para>
|
||||
The commands above do not remove garbage collector roots, such as
|
||||
old system configurations. Thus they do not remove the ability to
|
||||
roll back to previous configurations. The following command deletes
|
||||
old roots, removing the ability to roll back to them:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-collect-garbage -d
|
||||
</programlisting>
|
||||
<para>
|
||||
You can also do this for specific profiles, e.g.
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-env -p /nix/var/nix/profiles/per-user/eelco/profile --delete-generations old
|
||||
</programlisting>
|
||||
<para>
|
||||
Note that NixOS system configurations are stored in the profile
|
||||
<literal>/nix/var/nix/profiles/system</literal>.
|
||||
</para>
|
||||
<para>
|
||||
Another way to reclaim disk space (often as much as 40% of the size
|
||||
of the Nix store) is to run Nix’s store optimiser, which seeks out
|
||||
identical files in the store and replaces them with hard links to a
|
||||
single copy.
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-store --optimise
|
||||
</programlisting>
|
||||
<para>
|
||||
Since this command needs to read the entire Nix store, it can take
|
||||
quite a while to finish.
|
||||
</para>
|
||||
<section xml:id="sect-nixos-gc-boot-entries">
|
||||
<title>NixOS Boot Entries</title>
|
||||
<para>
|
||||
If your <literal>/boot</literal> partition runs out of space,
|
||||
after clearing old profiles you must rebuild your system with
|
||||
<literal>nixos-rebuild boot</literal> or
|
||||
<literal>nixos-rebuild switch</literal> to update the
|
||||
<literal>/boot</literal> partition and clear space.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
@@ -1,54 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-container-networking">
|
||||
<title>Container Networking</title>
|
||||
<para>
|
||||
When you create a container using
|
||||
<literal>nixos-container create</literal>, it gets it own private
|
||||
IPv4 address in the range <literal>10.233.0.0/16</literal>. You can
|
||||
get the container’s IPv4 address as follows:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container show-ip foo
|
||||
10.233.4.2
|
||||
|
||||
$ ping -c1 10.233.4.2
|
||||
64 bytes from 10.233.4.2: icmp_seq=1 ttl=64 time=0.106 ms
|
||||
</programlisting>
|
||||
<para>
|
||||
Networking is implemented using a pair of virtual Ethernet devices.
|
||||
The network interface in the container is called
|
||||
<literal>eth0</literal>, while the matching interface in the host is
|
||||
called <literal>ve-container-name</literal> (e.g.,
|
||||
<literal>ve-foo</literal>). The container has its own network
|
||||
namespace and the <literal>CAP_NET_ADMIN</literal> capability, so it
|
||||
can perform arbitrary network configuration such as setting up
|
||||
firewall rules, without affecting or having access to the host’s
|
||||
network.
|
||||
</para>
|
||||
<para>
|
||||
By default, containers cannot talk to the outside network. If you
|
||||
want that, you should set up Network Address Translation (NAT) rules
|
||||
on the host to rewrite container traffic to use your external IP
|
||||
address. This can be accomplished using the following configuration
|
||||
on the host:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
networking.nat.enable = true;
|
||||
networking.nat.internalInterfaces = ["ve-+"];
|
||||
networking.nat.externalInterface = "eth0";
|
||||
</programlisting>
|
||||
<para>
|
||||
where <literal>eth0</literal> should be replaced with the desired
|
||||
external interface. Note that <literal>ve-+</literal> is a wildcard
|
||||
that matches all container interfaces.
|
||||
</para>
|
||||
<para>
|
||||
If you are using Network Manager, you need to explicitly prevent it
|
||||
from managing container interfaces:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
|
||||
</programlisting>
|
||||
<para>
|
||||
You may need to restart your system for the changes to take effect.
|
||||
</para>
|
||||
</section>
|
||||
@@ -1,31 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="ch-containers">
|
||||
<title>Container Management</title>
|
||||
<para>
|
||||
NixOS allows you to easily run other NixOS instances as
|
||||
<emphasis>containers</emphasis>. Containers are a light-weight
|
||||
approach to virtualisation that runs software in the container at
|
||||
the same speed as in the host system. NixOS containers share the Nix
|
||||
store of the host, making container creation very efficient.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
Currently, NixOS containers are not perfectly isolated from the
|
||||
host system. This means that a user with root access to the
|
||||
container can do things that affect the host. So you should not
|
||||
give container root access to untrusted users.
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
NixOS containers can be created in two ways: imperatively, using the
|
||||
command <literal>nixos-container</literal>, and declaratively, by
|
||||
specifying them in your <literal>configuration.nix</literal>. The
|
||||
declarative approach implies that containers get upgraded along with
|
||||
your host system when you run <literal>nixos-rebuild</literal>,
|
||||
which is often not what you want. By contrast, in the imperative
|
||||
approach, containers are configured and updated independently from
|
||||
the host system.
|
||||
</para>
|
||||
<xi:include href="imperative-containers.section.xml" />
|
||||
<xi:include href="declarative-containers.section.xml" />
|
||||
<xi:include href="container-networking.section.xml" />
|
||||
</chapter>
|
||||
@@ -1,67 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-cgroups">
|
||||
<title>Control Groups</title>
|
||||
<para>
|
||||
To keep track of the processes in a running system, systemd uses
|
||||
<emphasis>control groups</emphasis> (cgroups). A control group is a
|
||||
set of processes used to allocate resources such as CPU, memory or
|
||||
I/O bandwidth. There can be multiple control group hierarchies,
|
||||
allowing each kind of resource to be managed independently.
|
||||
</para>
|
||||
<para>
|
||||
The command <literal>systemd-cgls</literal> lists all control groups
|
||||
in the <literal>systemd</literal> hierarchy, which is what systemd
|
||||
uses to keep track of the processes belonging to each service or
|
||||
user session:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ systemd-cgls
|
||||
├─user
|
||||
│ └─eelco
|
||||
│ └─c1
|
||||
│ ├─ 2567 -:0
|
||||
│ ├─ 2682 kdeinit4: kdeinit4 Running...
|
||||
│ ├─ ...
|
||||
│ └─10851 sh -c less -R
|
||||
└─system
|
||||
├─httpd.service
|
||||
│ ├─2444 httpd -f /nix/store/3pyacby5cpr55a03qwbnndizpciwq161-httpd.conf -DNO_DETACH
|
||||
│ └─...
|
||||
├─dhcpcd.service
|
||||
│ └─2376 dhcpcd --config /nix/store/f8dif8dsi2yaa70n03xir8r653776ka6-dhcpcd.conf
|
||||
└─ ...
|
||||
</programlisting>
|
||||
<para>
|
||||
Similarly, <literal>systemd-cgls cpu</literal> shows the cgroups in
|
||||
the CPU hierarchy, which allows per-cgroup CPU scheduling
|
||||
priorities. By default, every systemd service gets its own CPU
|
||||
cgroup, while all user sessions are in the top-level CPU cgroup.
|
||||
This ensures, for instance, that a thousand run-away processes in
|
||||
the <literal>httpd.service</literal> cgroup cannot starve the CPU
|
||||
for one process in the <literal>postgresql.service</literal> cgroup.
|
||||
(By contrast, it they were in the same cgroup, then the PostgreSQL
|
||||
process would get 1/1001 of the cgroup’s CPU time.) You can limit a
|
||||
service’s CPU share in <literal>configuration.nix</literal>:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
systemd.services.httpd.serviceConfig.CPUShares = 512;
|
||||
</programlisting>
|
||||
<para>
|
||||
By default, every cgroup has 1024 CPU shares, so this will halve the
|
||||
CPU allocation of the <literal>httpd.service</literal> cgroup.
|
||||
</para>
|
||||
<para>
|
||||
There also is a <literal>memory</literal> hierarchy that controls
|
||||
memory allocation limits; by default, all processes are in the
|
||||
top-level cgroup, so any service or session can exhaust all
|
||||
available memory. Per-cgroup memory limits can be specified in
|
||||
<literal>configuration.nix</literal>; for instance, to limit
|
||||
<literal>httpd.service</literal> to 512 MiB of RAM (excluding swap):
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
systemd.services.httpd.serviceConfig.MemoryLimit = "512M";
|
||||
</programlisting>
|
||||
<para>
|
||||
The command <literal>systemd-cgtop</literal> shows a continuously
|
||||
updated list of all cgroups with their CPU and memory usage.
|
||||
</para>
|
||||
</chapter>
|
||||
@@ -1,60 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-declarative-containers">
|
||||
<title>Declarative Container Specification</title>
|
||||
<para>
|
||||
You can also specify containers and their configuration in the
|
||||
host’s <literal>configuration.nix</literal>. For example, the
|
||||
following specifies that there shall be a container named
|
||||
<literal>database</literal> running PostgreSQL:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
containers.database =
|
||||
{ config =
|
||||
{ config, pkgs, ... }:
|
||||
{ services.postgresql.enable = true;
|
||||
services.postgresql.package = pkgs.postgresql_14;
|
||||
};
|
||||
};
|
||||
</programlisting>
|
||||
<para>
|
||||
If you run <literal>nixos-rebuild switch</literal>, the container
|
||||
will be built. If the container was already running, it will be
|
||||
updated in place, without rebooting. The container can be configured
|
||||
to start automatically by setting
|
||||
<literal>containers.database.autoStart = true</literal> in its
|
||||
configuration.
|
||||
</para>
|
||||
<para>
|
||||
By default, declarative containers share the network namespace of
|
||||
the host, meaning that they can listen on (privileged) ports.
|
||||
However, they cannot change the network configuration. You can give
|
||||
a container its own network as follows:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
containers.database = {
|
||||
privateNetwork = true;
|
||||
hostAddress = "192.168.100.10";
|
||||
localAddress = "192.168.100.11";
|
||||
};
|
||||
</programlisting>
|
||||
<para>
|
||||
This gives the container a private virtual Ethernet interface with
|
||||
IP address <literal>192.168.100.11</literal>, which is hooked up to
|
||||
a virtual Ethernet interface on the host with IP address
|
||||
<literal>192.168.100.10</literal>. (See the next section for details
|
||||
on container networking.)
|
||||
</para>
|
||||
<para>
|
||||
To disable the container, just remove it from
|
||||
<literal>configuration.nix</literal> and run
|
||||
<literal>nixos-rebuild switch</literal>. Note that this will not
|
||||
delete the root directory of the container in
|
||||
<literal>/var/lib/nixos-containers</literal>. Containers can be
|
||||
destroyed using the imperative method:
|
||||
<literal>nixos-container destroy foo</literal>.
|
||||
</para>
|
||||
<para>
|
||||
Declarative containers can be started and stopped using the
|
||||
corresponding systemd service, e.g.
|
||||
<literal>systemctl start container@database</literal>.
|
||||
</para>
|
||||
</section>
|
||||
@@ -1,132 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-imperative-containers">
|
||||
<title>Imperative Container Management</title>
|
||||
<para>
|
||||
We’ll cover imperative container management using
|
||||
<literal>nixos-container</literal> first. Be aware that container
|
||||
management is currently only possible as <literal>root</literal>.
|
||||
</para>
|
||||
<para>
|
||||
You create a container with identifier <literal>foo</literal> as
|
||||
follows:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container create foo
|
||||
</programlisting>
|
||||
<para>
|
||||
This creates the container’s root directory in
|
||||
<literal>/var/lib/nixos-containers/foo</literal> and a small
|
||||
configuration file in
|
||||
<literal>/etc/nixos-containers/foo.conf</literal>. It also builds
|
||||
the container’s initial system configuration and stores it in
|
||||
<literal>/nix/var/nix/profiles/per-container/foo/system</literal>.
|
||||
You can modify the initial configuration of the container on the
|
||||
command line. For instance, to create a container that has
|
||||
<literal>sshd</literal> running, with the given public key for
|
||||
<literal>root</literal>:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container create foo --config '
|
||||
services.openssh.enable = true;
|
||||
users.users.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"];
|
||||
'
|
||||
</programlisting>
|
||||
<para>
|
||||
By default the next free address in the
|
||||
<literal>10.233.0.0/16</literal> subnet will be chosen as container
|
||||
IP. This behavior can be altered by setting
|
||||
<literal>--host-address</literal> and
|
||||
<literal>--local-address</literal>:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container create test --config-file test-container.nix \
|
||||
--local-address 10.235.1.2 --host-address 10.235.1.1
|
||||
</programlisting>
|
||||
<para>
|
||||
Creating a container does not start it. To start the container, run:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container start foo
|
||||
</programlisting>
|
||||
<para>
|
||||
This command will return as soon as the container has booted and has
|
||||
reached <literal>multi-user.target</literal>. On the host, the
|
||||
container runs within a systemd unit called
|
||||
<literal>container@container-name.service</literal>. Thus, if
|
||||
something went wrong, you can get status info using
|
||||
<literal>systemctl</literal>:
|
||||
</para>
|
||||
<programlisting>
|
||||
# systemctl status container@foo
|
||||
</programlisting>
|
||||
<para>
|
||||
If the container has started successfully, you can log in as root
|
||||
using the <literal>root-login</literal> operation:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container root-login foo
|
||||
[root@foo:~]#
|
||||
</programlisting>
|
||||
<para>
|
||||
Note that only root on the host can do this (since there is no
|
||||
authentication). You can also get a regular login prompt using the
|
||||
<literal>login</literal> operation, which is available to all users
|
||||
on the host:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container login foo
|
||||
foo login: alice
|
||||
Password: ***
|
||||
</programlisting>
|
||||
<para>
|
||||
With <literal>nixos-container run</literal>, you can execute
|
||||
arbitrary commands in the container:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container run foo -- uname -a
|
||||
Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
|
||||
</programlisting>
|
||||
<para>
|
||||
There are several ways to change the configuration of the container.
|
||||
First, on the host, you can edit
|
||||
<literal>/var/lib/container/name/etc/nixos/configuration.nix</literal>,
|
||||
and run
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container update foo
|
||||
</programlisting>
|
||||
<para>
|
||||
This will build and activate the new configuration. You can also
|
||||
specify a new configuration on the command line:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container update foo --config '
|
||||
services.httpd.enable = true;
|
||||
services.httpd.adminAddr = "foo@example.org";
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
'
|
||||
|
||||
# curl http://$(nixos-container show-ip foo)/
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">…
|
||||
</programlisting>
|
||||
<para>
|
||||
However, note that this will overwrite the container’s
|
||||
<literal>/etc/nixos/configuration.nix</literal>.
|
||||
</para>
|
||||
<para>
|
||||
Alternatively, you can change the configuration from within the
|
||||
container itself by running <literal>nixos-rebuild switch</literal>
|
||||
inside the container. Note that the container by default does not
|
||||
have a copy of the NixOS channel, so you should run
|
||||
<literal>nix-channel --update</literal> first.
|
||||
</para>
|
||||
<para>
|
||||
Containers can be stopped and started using
|
||||
<literal>nixos-container stop</literal> and
|
||||
<literal>nixos-container start</literal>, respectively, or by using
|
||||
<literal>systemctl</literal> on the container’s service unit. To
|
||||
destroy a container, including its file system, do
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-container destroy foo
|
||||
</programlisting>
|
||||
</section>
|
||||
@@ -1,45 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-logging">
|
||||
<title>Logging</title>
|
||||
<para>
|
||||
System-wide logging is provided by systemd’s
|
||||
<emphasis>journal</emphasis>, which subsumes traditional logging
|
||||
daemons such as syslogd and klogd. Log entries are kept in binary
|
||||
files in <literal>/var/log/journal/</literal>. The command
|
||||
<literal>journalctl</literal> allows you to see the contents of the
|
||||
journal. For example,
|
||||
</para>
|
||||
<programlisting>
|
||||
$ journalctl -b
|
||||
</programlisting>
|
||||
<para>
|
||||
shows all journal entries since the last reboot. (The output of
|
||||
<literal>journalctl</literal> is piped into <literal>less</literal>
|
||||
by default.) You can use various options and match operators to
|
||||
restrict output to messages of interest. For instance, to get all
|
||||
messages from PostgreSQL:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ journalctl -u postgresql.service
|
||||
-- Logs begin at Mon, 2013-01-07 13:28:01 CET, end at Tue, 2013-01-08 01:09:57 CET. --
|
||||
...
|
||||
Jan 07 15:44:14 hagbard postgres[2681]: [2-1] LOG: database system is shut down
|
||||
-- Reboot --
|
||||
Jan 07 15:45:10 hagbard postgres[2532]: [1-1] LOG: database system was shut down at 2013-01-07 15:44:14 CET
|
||||
Jan 07 15:45:13 hagbard postgres[2500]: [1-1] LOG: database system is ready to accept connections
|
||||
</programlisting>
|
||||
<para>
|
||||
Or to get all messages since the last reboot that have at least a
|
||||
<quote>critical</quote> severity level:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ journalctl -b -p crit
|
||||
Dec 17 21:08:06 mandark sudo[3673]: pam_unix(sudo:auth): auth could not identify password for [alice]
|
||||
Dec 29 01:30:22 mandark kernel[6131]: [1053513.909444] CPU6: Core temperature above threshold, cpu clock throttled (total events = 1)
|
||||
</programlisting>
|
||||
<para>
|
||||
The system journal is readable by root and by users in the
|
||||
<literal>wheel</literal> and <literal>systemd-journal</literal>
|
||||
groups. All users have a private journal that can be read using
|
||||
<literal>journalctl</literal>.
|
||||
</para>
|
||||
</chapter>
|
||||
@@ -1,14 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-maintenance-mode">
|
||||
<title>Maintenance Mode</title>
|
||||
<para>
|
||||
You can enter rescue mode by running:
|
||||
</para>
|
||||
<programlisting>
|
||||
# systemctl rescue
|
||||
</programlisting>
|
||||
<para>
|
||||
This will eventually give you a single-user root shell. Systemd will
|
||||
stop (almost) all system services. To get out of maintenance mode,
|
||||
just exit from the rescue shell.
|
||||
</para>
|
||||
</section>
|
||||
@@ -1,25 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-nix-network-issues">
|
||||
<title>Network Problems</title>
|
||||
<para>
|
||||
Nix uses a so-called <emphasis>binary cache</emphasis> to optimise
|
||||
building a package from source into downloading it as a pre-built
|
||||
binary. That is, whenever a command like
|
||||
<literal>nixos-rebuild</literal> needs a path in the Nix store, Nix
|
||||
will try to download that path from the Internet rather than build
|
||||
it from source. The default binary cache is
|
||||
<literal>https://cache.nixos.org/</literal>. If this cache is
|
||||
unreachable, Nix operations may take a long time due to HTTP
|
||||
connection timeouts. You can disable the use of the binary cache by
|
||||
adding <literal>--option use-binary-caches false</literal>, e.g.
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-rebuild switch --option use-binary-caches false
|
||||
</programlisting>
|
||||
<para>
|
||||
If you have an alternative binary cache at your disposal, you can
|
||||
use it instead:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-rebuild switch --option binary-caches http://my-cache.example.org/
|
||||
</programlisting>
|
||||
</section>
|
||||
@@ -1,38 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-rebooting">
|
||||
<title>Rebooting and Shutting Down</title>
|
||||
<para>
|
||||
The system can be shut down (and automatically powered off) by
|
||||
doing:
|
||||
</para>
|
||||
<programlisting>
|
||||
# shutdown
|
||||
</programlisting>
|
||||
<para>
|
||||
This is equivalent to running <literal>systemctl poweroff</literal>.
|
||||
</para>
|
||||
<para>
|
||||
To reboot the system, run
|
||||
</para>
|
||||
<programlisting>
|
||||
# reboot
|
||||
</programlisting>
|
||||
<para>
|
||||
which is equivalent to <literal>systemctl reboot</literal>.
|
||||
Alternatively, you can quickly reboot the system using
|
||||
<literal>kexec</literal>, which bypasses the BIOS by directly
|
||||
loading the new kernel into memory:
|
||||
</para>
|
||||
<programlisting>
|
||||
# systemctl kexec
|
||||
</programlisting>
|
||||
<para>
|
||||
The machine can be suspended to RAM (if supported) using
|
||||
<literal>systemctl suspend</literal>, and suspended to disk using
|
||||
<literal>systemctl hibernate</literal>.
|
||||
</para>
|
||||
<para>
|
||||
These commands can be run by any user who is logged in locally, i.e.
|
||||
on a virtual console or in X11; otherwise, the user is asked for
|
||||
authentication.
|
||||
</para>
|
||||
</chapter>
|
||||
@@ -1,42 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-rollback">
|
||||
<title>Rolling Back Configuration Changes</title>
|
||||
<para>
|
||||
After running <literal>nixos-rebuild</literal> to switch to a new
|
||||
configuration, you may find that the new configuration doesn’t work
|
||||
very well. In that case, there are several ways to return to a
|
||||
previous configuration.
|
||||
</para>
|
||||
<para>
|
||||
First, the GRUB boot manager allows you to boot into any previous
|
||||
configuration that hasn’t been garbage-collected. These
|
||||
configurations can be found under the GRUB submenu <quote>NixOS -
|
||||
All configurations</quote>. This is especially useful if the new
|
||||
configuration fails to boot. After the system has booted, you can
|
||||
make the selected configuration the default for subsequent boots:
|
||||
</para>
|
||||
<programlisting>
|
||||
# /run/current-system/bin/switch-to-configuration boot
|
||||
</programlisting>
|
||||
<para>
|
||||
Second, you can switch to the previous configuration in a running
|
||||
system:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-rebuild switch --rollback
|
||||
</programlisting>
|
||||
<para>
|
||||
This is equivalent to running:
|
||||
</para>
|
||||
<programlisting>
|
||||
# /nix/var/nix/profiles/system-N-link/bin/switch-to-configuration switch
|
||||
</programlisting>
|
||||
<para>
|
||||
where <literal>N</literal> is the number of the NixOS system
|
||||
configuration. To get a list of the available configurations, do:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ ls -l /nix/var/nix/profiles/system-*-link
|
||||
...
|
||||
lrwxrwxrwx 1 root root 78 Aug 12 13:54 /nix/var/nix/profiles/system-268-link -> /nix/store/202b...-nixos-13.07pre4932_5a676e4-4be1055
|
||||
</programlisting>
|
||||
</section>
|
||||
@@ -1,141 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-systemctl">
|
||||
<title>Service Management</title>
|
||||
<para>
|
||||
In NixOS, all system services are started and monitored using the
|
||||
systemd program. systemd is the <quote>init</quote> process of the
|
||||
system (i.e. PID 1), the parent of all other processes. It manages a
|
||||
set of so-called <quote>units</quote>, which can be things like
|
||||
system services (programs), but also mount points, swap files,
|
||||
devices, targets (groups of units) and more. Units can have complex
|
||||
dependencies; for instance, one unit can require that another unit
|
||||
must be successfully started before the first unit can be started.
|
||||
When the system boots, it starts a unit named
|
||||
<literal>default.target</literal>; the dependencies of this unit
|
||||
cause all system services to be started, file systems to be mounted,
|
||||
swap files to be activated, and so on.
|
||||
</para>
|
||||
<section xml:id="sect-nixos-systemd-general">
|
||||
<title>Interacting with a running systemd</title>
|
||||
<para>
|
||||
The command <literal>systemctl</literal> is the main way to
|
||||
interact with <literal>systemd</literal>. The following paragraphs
|
||||
demonstrate ways to interact with any OS running systemd as init
|
||||
system. NixOS is of no exception. The
|
||||
<link linkend="sect-nixos-systemd-nixos">next section </link>
|
||||
explains NixOS specific things worth knowing.
|
||||
</para>
|
||||
<para>
|
||||
Without any arguments, <literal>systemctl</literal> the status of
|
||||
active units:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ systemctl
|
||||
-.mount loaded active mounted /
|
||||
swapfile.swap loaded active active /swapfile
|
||||
sshd.service loaded active running SSH Daemon
|
||||
graphical.target loaded active active Graphical Interface
|
||||
...
|
||||
</programlisting>
|
||||
<para>
|
||||
You can ask for detailed status information about a unit, for
|
||||
instance, the PostgreSQL database service:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ systemctl status postgresql.service
|
||||
postgresql.service - PostgreSQL Server
|
||||
Loaded: loaded (/nix/store/pn3q73mvh75gsrl8w7fdlfk3fq5qm5mw-unit/postgresql.service)
|
||||
Active: active (running) since Mon, 2013-01-07 15:55:57 CET; 9h ago
|
||||
Main PID: 2390 (postgres)
|
||||
CGroup: name=systemd:/system/postgresql.service
|
||||
├─2390 postgres
|
||||
├─2418 postgres: writer process
|
||||
├─2419 postgres: wal writer process
|
||||
├─2420 postgres: autovacuum launcher process
|
||||
├─2421 postgres: stats collector process
|
||||
└─2498 postgres: zabbix zabbix [local] idle
|
||||
|
||||
Jan 07 15:55:55 hagbard postgres[2394]: [1-1] LOG: database system was shut down at 2013-01-07 15:55:05 CET
|
||||
Jan 07 15:55:57 hagbard postgres[2390]: [1-1] LOG: database system is ready to accept connections
|
||||
Jan 07 15:55:57 hagbard postgres[2420]: [1-1] LOG: autovacuum launcher started
|
||||
Jan 07 15:55:57 hagbard systemd[1]: Started PostgreSQL Server.
|
||||
</programlisting>
|
||||
<para>
|
||||
Note that this shows the status of the unit (active and running),
|
||||
all the processes belonging to the service, as well as the most
|
||||
recent log messages from the service.
|
||||
</para>
|
||||
<para>
|
||||
Units can be stopped, started or restarted:
|
||||
</para>
|
||||
<programlisting>
|
||||
# systemctl stop postgresql.service
|
||||
# systemctl start postgresql.service
|
||||
# systemctl restart postgresql.service
|
||||
</programlisting>
|
||||
<para>
|
||||
These operations are synchronous: they wait until the service has
|
||||
finished starting or stopping (or has failed). Starting a unit
|
||||
will cause the dependencies of that unit to be started as well (if
|
||||
necessary).
|
||||
</para>
|
||||
</section>
|
||||
<section xml:id="sect-nixos-systemd-nixos">
|
||||
<title>systemd in NixOS</title>
|
||||
<para>
|
||||
Packages in Nixpkgs sometimes provide systemd units with them,
|
||||
usually in e.g <literal>#pkg-out#/lib/systemd/</literal>. Putting
|
||||
such a package in <literal>environment.systemPackages</literal>
|
||||
doesn’t make the service available to users or the system.
|
||||
</para>
|
||||
<para>
|
||||
In order to enable a systemd <emphasis>system</emphasis> service
|
||||
with provided upstream package, use (e.g):
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
systemd.packages = [ pkgs.packagekit ];
|
||||
</programlisting>
|
||||
<para>
|
||||
Usually NixOS modules written by the community do the above, plus
|
||||
take care of other details. If a module was written for a service
|
||||
you are interested in, you’d probably need only to use
|
||||
<literal>services.#name#.enable = true;</literal>. These services
|
||||
are defined in Nixpkgs’
|
||||
<link xlink:href="https://github.com/NixOS/nixpkgs/tree/master/nixos/modules">
|
||||
<literal>nixos/modules/</literal> directory </link>. In case the
|
||||
service is simple enough, the above method should work, and start
|
||||
the service on boot.
|
||||
</para>
|
||||
<para>
|
||||
<emphasis>User</emphasis> systemd services on the other hand,
|
||||
should be treated differently. Given a package that has a systemd
|
||||
unit file at <literal>#pkg-out#/lib/systemd/user/</literal>, using
|
||||
<xref linkend="opt-systemd.packages" /> will make you able to
|
||||
start the service via <literal>systemctl --user start</literal>,
|
||||
but it won’t start automatically on login. However, You can
|
||||
imperatively enable it by adding the package’s attribute to
|
||||
<xref linkend="opt-systemd.packages" /> and then do this (e.g):
|
||||
</para>
|
||||
<programlisting>
|
||||
$ mkdir -p ~/.config/systemd/user/default.target.wants
|
||||
$ ln -s /run/current-system/sw/lib/systemd/user/syncthing.service ~/.config/systemd/user/default.target.wants/
|
||||
$ systemctl --user daemon-reload
|
||||
$ systemctl --user enable syncthing.service
|
||||
</programlisting>
|
||||
<para>
|
||||
If you are interested in a timer file, use
|
||||
<literal>timers.target.wants</literal> instead of
|
||||
<literal>default.target.wants</literal> in the 1st and 2nd
|
||||
command.
|
||||
</para>
|
||||
<para>
|
||||
Using <literal>systemctl --user enable syncthing.service</literal>
|
||||
instead of the above, will work, but it’ll use the absolute path
|
||||
of <literal>syncthing.service</literal> for the symlink, and this
|
||||
path is in <literal>/nix/store/.../lib/systemd/user/</literal>.
|
||||
Hence <link linkend="sec-nix-gc">garbage collection</link> will
|
||||
remove that file and you will wind up with a broken symlink in
|
||||
your systemd configuration, which in turn will not make the
|
||||
service / timer start on login.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
@@ -1,34 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-nix-store-corruption">
|
||||
<title>Nix Store Corruption</title>
|
||||
<para>
|
||||
After a system crash, it’s possible for files in the Nix store to
|
||||
become corrupted. (For instance, the Ext4 file system has the
|
||||
tendency to replace un-synced files with zero bytes.) NixOS tries
|
||||
hard to prevent this from happening: it performs a
|
||||
<literal>sync</literal> before switching to a new configuration, and
|
||||
Nix’s database is fully transactional. If corruption still occurs,
|
||||
you may be able to fix it automatically.
|
||||
</para>
|
||||
<para>
|
||||
If the corruption is in a path in the closure of the NixOS system
|
||||
configuration, you can fix it by doing
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-rebuild switch --repair
|
||||
</programlisting>
|
||||
<para>
|
||||
This will cause Nix to check every path in the closure, and if its
|
||||
cryptographic hash differs from the hash recorded in Nix’s database,
|
||||
the path is rebuilt or redownloaded.
|
||||
</para>
|
||||
<para>
|
||||
You can also scan the entire Nix store for corrupt paths:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nix-store --verify --check-contents --repair
|
||||
</programlisting>
|
||||
<para>
|
||||
Any corrupt paths will be redownloaded if they’re available in a
|
||||
binary cache; otherwise, they cannot be repaired.
|
||||
</para>
|
||||
</section>
|
||||
@@ -1,12 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="ch-troubleshooting">
|
||||
<title>Troubleshooting</title>
|
||||
<para>
|
||||
This chapter describes solutions to common problems you might
|
||||
encounter when you manage your NixOS system.
|
||||
</para>
|
||||
<xi:include href="boot-problems.section.xml" />
|
||||
<xi:include href="maintenance-mode.section.xml" />
|
||||
<xi:include href="rollback.section.xml" />
|
||||
<xi:include href="store-corruption.section.xml" />
|
||||
<xi:include href="network-problems.section.xml" />
|
||||
</chapter>
|
||||
@@ -1,46 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-user-sessions">
|
||||
<title>User Sessions</title>
|
||||
<para>
|
||||
Systemd keeps track of all users who are logged into the system
|
||||
(e.g. on a virtual console or remotely via SSH). The command
|
||||
<literal>loginctl</literal> allows querying and manipulating user
|
||||
sessions. For instance, to list all user sessions:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ loginctl
|
||||
SESSION UID USER SEAT
|
||||
c1 500 eelco seat0
|
||||
c3 0 root seat0
|
||||
c4 500 alice
|
||||
</programlisting>
|
||||
<para>
|
||||
This shows that two users are logged in locally, while another is
|
||||
logged in remotely. (<quote>Seats</quote> are essentially the
|
||||
combinations of displays and input devices attached to the system;
|
||||
usually, there is only one seat.) To get information about a
|
||||
session:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ loginctl session-status c3
|
||||
c3 - root (0)
|
||||
Since: Tue, 2013-01-08 01:17:56 CET; 4min 42s ago
|
||||
Leader: 2536 (login)
|
||||
Seat: seat0; vc3
|
||||
TTY: /dev/tty3
|
||||
Service: login; type tty; class user
|
||||
State: online
|
||||
CGroup: name=systemd:/user/root/c3
|
||||
├─ 2536 /nix/store/10mn4xip9n7y9bxqwnsx7xwx2v2g34xn-shadow-4.1.5.1/bin/login --
|
||||
├─10339 -bash
|
||||
└─10355 w3m nixos.org
|
||||
</programlisting>
|
||||
<para>
|
||||
This shows that the user is logged in on virtual console 3. It also
|
||||
lists the processes belonging to this session. Since systemd keeps
|
||||
track of this, you can terminate a session in a way that ensures
|
||||
that all the session’s processes are gone:
|
||||
</para>
|
||||
<programlisting>
|
||||
# loginctl terminate-session c3
|
||||
</programlisting>
|
||||
</chapter>
|
||||
@@ -1,101 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-module-abstractions">
|
||||
<title>Abstractions</title>
|
||||
<para>
|
||||
If you find yourself repeating yourself over and over, it’s time to
|
||||
abstract. Take, for instance, this Apache HTTP Server configuration:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
{
|
||||
services.httpd.virtualHosts =
|
||||
{ "blog.example.org" = {
|
||||
documentRoot = "/webroot/blog.example.org";
|
||||
adminAddr = "alice@example.org";
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
enablePHP = true;
|
||||
};
|
||||
"wiki.example.org" = {
|
||||
documentRoot = "/webroot/wiki.example.org";
|
||||
adminAddr = "alice@example.org";
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
enablePHP = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
It defines two virtual hosts with nearly identical configuration;
|
||||
the only difference is the document root directories. To prevent
|
||||
this duplication, we can use a <literal>let</literal>:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
let
|
||||
commonConfig =
|
||||
{ adminAddr = "alice@example.org";
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
services.httpd.virtualHosts =
|
||||
{ "blog.example.org" = (commonConfig // { documentRoot = "/webroot/blog.example.org"; });
|
||||
"wiki.example.org" = (commonConfig // { documentRoot = "/webroot/wiki.example.com"; });
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
The <literal>let commonConfig = ...</literal> defines a variable
|
||||
named <literal>commonConfig</literal>. The <literal>//</literal>
|
||||
operator merges two attribute sets, so the configuration of the
|
||||
second virtual host is the set <literal>commonConfig</literal>
|
||||
extended with the document root option.
|
||||
</para>
|
||||
<para>
|
||||
You can write a <literal>let</literal> wherever an expression is
|
||||
allowed. Thus, you also could have written:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
{
|
||||
services.httpd.virtualHosts =
|
||||
let commonConfig = ...; in
|
||||
{ "blog.example.org" = (commonConfig // { ... })
|
||||
"wiki.example.org" = (commonConfig // { ... })
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
but not <literal>{ let commonConfig = ...; in ...; }</literal> since
|
||||
attributes (as opposed to attribute values) are not expressions.
|
||||
</para>
|
||||
<para>
|
||||
<emphasis role="strong">Functions</emphasis> provide another method
|
||||
of abstraction. For instance, suppose that we want to generate lots
|
||||
of different virtual hosts, all with identical configuration except
|
||||
for the document root. This can be done as follows:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
{
|
||||
services.httpd.virtualHosts =
|
||||
let
|
||||
makeVirtualHost = webroot:
|
||||
{ documentRoot = webroot;
|
||||
adminAddr = "alice@example.org";
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
};
|
||||
in
|
||||
{ "example.org" = (makeVirtualHost "/webroot/example.org");
|
||||
"example.com" = (makeVirtualHost "/webroot/example.com");
|
||||
"example.gov" = (makeVirtualHost "/webroot/example.gov");
|
||||
"example.nl" = (makeVirtualHost "/webroot/example.nl");
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
Here, <literal>makeVirtualHost</literal> is a function that takes a
|
||||
single argument <literal>webroot</literal> and returns the
|
||||
configuration for a virtual host. That function is then called for
|
||||
several names to produce the list of virtual host configurations.
|
||||
</para>
|
||||
</section>
|
||||
@@ -1,16 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="ad-hoc-network-config">
|
||||
<title>Ad-Hoc Configuration</title>
|
||||
<para>
|
||||
You can use <xref linkend="opt-networking.localCommands" /> to
|
||||
specify shell commands to be run at the end of
|
||||
<literal>network-setup.service</literal>. This is useful for doing
|
||||
network configuration not covered by the existing NixOS modules. For
|
||||
instance, to statically configure an IPv6 address:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
networking.localCommands =
|
||||
''
|
||||
ip -6 addr add 2001:610:685:1::1/64 dev eth0
|
||||
'';
|
||||
</programlisting>
|
||||
</section>
|
||||
@@ -1,59 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-ad-hoc-packages">
|
||||
<title>Ad-Hoc Package Management</title>
|
||||
<para>
|
||||
With the command <literal>nix-env</literal>, you can install and
|
||||
uninstall packages from the command line. For instance, to install
|
||||
Mozilla Thunderbird:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-env -iA nixos.thunderbird
|
||||
</programlisting>
|
||||
<para>
|
||||
If you invoke this as root, the package is installed in the Nix
|
||||
profile <literal>/nix/var/nix/profiles/default</literal> and visible
|
||||
to all users of the system; otherwise, the package ends up in
|
||||
<literal>/nix/var/nix/profiles/per-user/username/profile</literal>
|
||||
and is not visible to other users. The <literal>-A</literal> flag
|
||||
specifies the package by its attribute name; without it, the package
|
||||
is installed by matching against its package name (e.g.
|
||||
<literal>thunderbird</literal>). The latter is slower because it
|
||||
requires matching against all available Nix packages, and is
|
||||
ambiguous if there are multiple matching packages.
|
||||
</para>
|
||||
<para>
|
||||
Packages come from the NixOS channel. You typically upgrade a
|
||||
package by updating to the latest version of the NixOS channel:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-channel --update nixos
|
||||
</programlisting>
|
||||
<para>
|
||||
and then running <literal>nix-env -i</literal> again. Other packages
|
||||
in the profile are <emphasis>not</emphasis> affected; this is the
|
||||
crucial difference with the declarative style of package management,
|
||||
where running <literal>nixos-rebuild switch</literal> causes all
|
||||
packages to be updated to their current versions in the NixOS
|
||||
channel. You can however upgrade all packages for which there is a
|
||||
newer version by doing:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-env -u '*'
|
||||
</programlisting>
|
||||
<para>
|
||||
A package can be uninstalled using the <literal>-e</literal> flag:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-env -e thunderbird
|
||||
</programlisting>
|
||||
<para>
|
||||
Finally, you can roll back an undesirable <literal>nix-env</literal>
|
||||
action:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-env --rollback
|
||||
</programlisting>
|
||||
<para>
|
||||
<literal>nix-env</literal> has many more flags. For details, see the
|
||||
nix-env(1) manpage or the Nix manual.
|
||||
</para>
|
||||
</section>
|
||||
@@ -1,118 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-custom-packages">
|
||||
<title>Adding Custom Packages</title>
|
||||
<para>
|
||||
It’s possible that a package you need is not available in NixOS. In
|
||||
that case, you can do two things. Either you can package it with
|
||||
Nix, or you can try to use prebuilt packages from upstream. Due to
|
||||
the peculiarities of NixOS, it is important to note that building
|
||||
software from source is often easier than using pre-built
|
||||
executables.
|
||||
</para>
|
||||
<section xml:id="sec-custom-packages-nix">
|
||||
<title>Building with Nix</title>
|
||||
<para>
|
||||
This can be done either in-tree or out-of-tree. For an in-tree
|
||||
build, you can clone the Nixpkgs repository, add the package to
|
||||
your clone, and (optionally) submit a patch or pull request to
|
||||
have it accepted into the main Nixpkgs repository. This is
|
||||
described in detail in the
|
||||
<link xlink:href="https://nixos.org/nixpkgs/manual">Nixpkgs
|
||||
manual</link>. In short, you clone Nixpkgs:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ git clone https://github.com/NixOS/nixpkgs
|
||||
$ cd nixpkgs
|
||||
</programlisting>
|
||||
<para>
|
||||
Then you write and test the package as described in the Nixpkgs
|
||||
manual. Finally, you add it to
|
||||
<xref linkend="opt-environment.systemPackages" />, e.g.
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
environment.systemPackages = [ pkgs.my-package ];
|
||||
</programlisting>
|
||||
<para>
|
||||
and you run <literal>nixos-rebuild</literal>, specifying your own
|
||||
Nixpkgs tree:
|
||||
</para>
|
||||
<programlisting>
|
||||
# nixos-rebuild switch -I nixpkgs=/path/to/my/nixpkgs
|
||||
</programlisting>
|
||||
<para>
|
||||
The second possibility is to add the package outside of the
|
||||
Nixpkgs tree. For instance, here is how you specify a build of the
|
||||
<link xlink:href="https://www.gnu.org/software/hello/">GNU
|
||||
Hello</link> package directly in
|
||||
<literal>configuration.nix</literal>:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
environment.systemPackages =
|
||||
let
|
||||
my-hello = with pkgs; stdenv.mkDerivation rec {
|
||||
name = "hello-2.8";
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/hello/${name}.tar.gz";
|
||||
sha256 = "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6";
|
||||
};
|
||||
};
|
||||
in
|
||||
[ my-hello ];
|
||||
</programlisting>
|
||||
<para>
|
||||
Of course, you can also move the definition of
|
||||
<literal>my-hello</literal> into a separate Nix expression, e.g.
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
environment.systemPackages = [ (import ./my-hello.nix) ];
|
||||
</programlisting>
|
||||
<para>
|
||||
where <literal>my-hello.nix</literal> contains:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
with import <nixpkgs> {}; # bring all of Nixpkgs into scope
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "hello-2.8";
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/hello/${name}.tar.gz";
|
||||
sha256 = "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6";
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
This allows testing the package easily:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-build my-hello.nix
|
||||
$ ./result/bin/hello
|
||||
Hello, world!
|
||||
</programlisting>
|
||||
</section>
|
||||
<section xml:id="sec-custom-packages-prebuilt">
|
||||
<title>Using pre-built executables</title>
|
||||
<para>
|
||||
Most pre-built executables will not work on NixOS. There are two
|
||||
notable exceptions: flatpaks and AppImages. For flatpaks see the
|
||||
<link linkend="module-services-flatpak">dedicated section</link>.
|
||||
AppImages will not run <quote>as-is</quote> on NixOS. First you
|
||||
need to install <literal>appimage-run</literal>: add to
|
||||
<literal>/etc/nixos/configuration.nix</literal>
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
environment.systemPackages = [ pkgs.appimage-run ];
|
||||
</programlisting>
|
||||
<para>
|
||||
Then instead of running the AppImage <quote>as-is</quote>, run
|
||||
<literal>appimage-run foo.appimage</literal>.
|
||||
</para>
|
||||
<para>
|
||||
To make other pre-built executables work on NixOS, you need to
|
||||
package them with Nix and special helpers like
|
||||
<literal>autoPatchelfHook</literal> or
|
||||
<literal>buildFHSUserEnv</literal>. See the
|
||||
<link xlink:href="https://nixos.org/nixpkgs/manual">Nixpkgs
|
||||
manual</link> for details. This is complex and often doing a
|
||||
source build is easier.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
@@ -1,231 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-configuration-file">
|
||||
<title>NixOS Configuration File</title>
|
||||
<para>
|
||||
The NixOS configuration file generally looks like this:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{ option definitions
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
The first line (<literal>{ config, pkgs, ... }:</literal>) denotes
|
||||
that this is actually a function that takes at least the two
|
||||
arguments <literal>config</literal> and <literal>pkgs</literal>.
|
||||
(These are explained later, in chapter
|
||||
<xref linkend="sec-writing-modules" />) The function returns a
|
||||
<emphasis>set</emphasis> of option definitions
|
||||
(<literal>{ ... }</literal>). These definitions have the form
|
||||
<literal>name = value</literal>, where <literal>name</literal> is
|
||||
the name of an option and <literal>value</literal> is its value. For
|
||||
example,
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{ services.httpd.enable = true;
|
||||
services.httpd.adminAddr = "alice@example.org";
|
||||
services.httpd.virtualHosts.localhost.documentRoot = "/webroot";
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
defines a configuration with three option definitions that together
|
||||
enable the Apache HTTP Server with <literal>/webroot</literal> as
|
||||
the document root.
|
||||
</para>
|
||||
<para>
|
||||
Sets can be nested, and in fact dots in option names are shorthand
|
||||
for defining a set containing another set. For instance,
|
||||
<xref linkend="opt-services.httpd.enable" /> defines a set named
|
||||
<literal>services</literal> that contains a set named
|
||||
<literal>httpd</literal>, which in turn contains an option
|
||||
definition named <literal>enable</literal> with value
|
||||
<literal>true</literal>. This means that the example above can also
|
||||
be written as:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{ services = {
|
||||
httpd = {
|
||||
enable = true;
|
||||
adminAddr = "alice@example.org";
|
||||
virtualHosts = {
|
||||
localhost = {
|
||||
documentRoot = "/webroot";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
which may be more convenient if you have lots of option definitions
|
||||
that share the same prefix (such as
|
||||
<literal>services.httpd</literal>).
|
||||
</para>
|
||||
<para>
|
||||
NixOS checks your option definitions for correctness. For instance,
|
||||
if you try to define an option that doesn’t exist (that is, doesn’t
|
||||
have a corresponding <emphasis>option declaration</emphasis>),
|
||||
<literal>nixos-rebuild</literal> will give an error like:
|
||||
</para>
|
||||
<programlisting>
|
||||
The option `services.httpd.enable' defined in `/etc/nixos/configuration.nix' does not exist.
|
||||
</programlisting>
|
||||
<para>
|
||||
Likewise, values in option definitions must have a correct type. For
|
||||
instance, <literal>services.httpd.enable</literal> must be a Boolean
|
||||
(<literal>true</literal> or <literal>false</literal>). Trying to
|
||||
give it a value of another type, such as a string, will cause an
|
||||
error:
|
||||
</para>
|
||||
<programlisting>
|
||||
The option value `services.httpd.enable' in `/etc/nixos/configuration.nix' is not a boolean.
|
||||
</programlisting>
|
||||
<para>
|
||||
Options have various types of values. The most important are:
|
||||
</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
Strings
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Strings are enclosed in double quotes, e.g.
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
networking.hostName = "dexter";
|
||||
</programlisting>
|
||||
<para>
|
||||
Special characters can be escaped by prefixing them with a
|
||||
backslash (e.g. <literal>\"</literal>).
|
||||
</para>
|
||||
<para>
|
||||
Multi-line strings can be enclosed in <emphasis>double single
|
||||
quotes</emphasis>, e.g.
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
networking.extraHosts =
|
||||
''
|
||||
127.0.0.2 other-localhost
|
||||
10.0.0.1 server
|
||||
'';
|
||||
</programlisting>
|
||||
<para>
|
||||
The main difference is that it strips from each line a number
|
||||
of spaces equal to the minimal indentation of the string as a
|
||||
whole (disregarding the indentation of empty lines), and that
|
||||
characters like <literal>"</literal> and
|
||||
<literal>\</literal> are not special (making it more
|
||||
convenient for including things like shell code). See more
|
||||
info about this in the Nix manual
|
||||
<link xlink:href="https://nixos.org/nix/manual/#ssec-values">here</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
Booleans
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
These can be <literal>true</literal> or
|
||||
<literal>false</literal>, e.g.
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
networking.firewall.enable = true;
|
||||
networking.firewall.allowPing = false;
|
||||
</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
Integers
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
For example,
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
boot.kernel.sysctl."net.ipv4.tcp_keepalive_time" = 60;
|
||||
</programlisting>
|
||||
<para>
|
||||
(Note that here the attribute name
|
||||
<literal>net.ipv4.tcp_keepalive_time</literal> is enclosed in
|
||||
quotes to prevent it from being interpreted as a set named
|
||||
<literal>net</literal> containing a set named
|
||||
<literal>ipv4</literal>, and so on. This is because it’s not a
|
||||
NixOS option but the literal name of a Linux kernel setting.)
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
Sets
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Sets were introduced above. They are name/value pairs enclosed
|
||||
in braces, as in the option definition
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/sda1";
|
||||
fsType = "ext4";
|
||||
options = [ "rw" "data=ordered" "relatime" ];
|
||||
};
|
||||
</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
Lists
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The important thing to note about lists is that list elements
|
||||
are separated by whitespace, like this:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
boot.kernelModules = [ "fuse" "kvm-intel" "coretemp" ];
|
||||
</programlisting>
|
||||
<para>
|
||||
List elements can be any other type, e.g. sets:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
|
||||
</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
Packages
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Usually, the packages you need are already part of the Nix
|
||||
Packages collection, which is a set that can be accessed
|
||||
through the function argument <literal>pkgs</literal>. Typical
|
||||
uses:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
environment.systemPackages =
|
||||
[ pkgs.thunderbird
|
||||
pkgs.emacs
|
||||
];
|
||||
|
||||
services.postgresql.package = pkgs.postgresql_14;
|
||||
</programlisting>
|
||||
<para>
|
||||
The latter option definition changes the default PostgreSQL
|
||||
package used by NixOS’s PostgreSQL service to 14.x. For more
|
||||
information on packages, including how to add new ones, see
|
||||
<xref linkend="sec-custom-packages" />.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</section>
|
||||
@@ -1,20 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="sec-configuration-syntax">
|
||||
<title>Configuration Syntax</title>
|
||||
<para>
|
||||
The NixOS configuration file
|
||||
<literal>/etc/nixos/configuration.nix</literal> is actually a
|
||||
<emphasis>Nix expression</emphasis>, which is the Nix package
|
||||
manager’s purely functional language for describing how to build
|
||||
packages and configurations. This means you have all the expressive
|
||||
power of that language at your disposal, including the ability to
|
||||
abstract over common patterns, which is very useful when managing
|
||||
complex systems. The syntax and semantics of the Nix language are
|
||||
fully described in the
|
||||
<link xlink:href="https://nixos.org/nix/manual/#chap-writing-nix-expressions">Nix
|
||||
manual</link>, but here we give a short overview of the most
|
||||
important constructs useful in NixOS configuration files.
|
||||
</para>
|
||||
<xi:include href="config-file.section.xml" />
|
||||
<xi:include href="abstractions.section.xml" />
|
||||
<xi:include href="modularity.section.xml" />
|
||||
</chapter>
|
||||
@@ -1,90 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-customising-packages">
|
||||
<title>Customising Packages</title>
|
||||
<para>
|
||||
Some packages in Nixpkgs have options to enable or disable optional
|
||||
functionality or change other aspects of the package. For instance,
|
||||
the Firefox wrapper package (which provides Firefox with a set of
|
||||
plugins such as the Adobe Flash player) has an option to enable the
|
||||
Google Talk plugin. It can be set in
|
||||
<literal>configuration.nix</literal> as follows:
|
||||
<literal>nixpkgs.config.firefox.enableGoogleTalkPlugin = true;</literal>
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
Unfortunately, Nixpkgs currently lacks a way to query available
|
||||
configuration options.
|
||||
</para>
|
||||
</warning>
|
||||
<para>
|
||||
Apart from high-level options, it’s possible to tweak a package in
|
||||
almost arbitrary ways, such as changing or disabling dependencies of
|
||||
a package. For instance, the Emacs package in Nixpkgs by default has
|
||||
a dependency on GTK 2. If you want to build it against GTK 3, you
|
||||
can specify that as follows:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
environment.systemPackages = [ (pkgs.emacs.override { gtk = pkgs.gtk3; }) ];
|
||||
</programlisting>
|
||||
<para>
|
||||
The function <literal>override</literal> performs the call to the
|
||||
Nix function that produces Emacs, with the original arguments
|
||||
amended by the set of arguments specified by you. So here the
|
||||
function argument <literal>gtk</literal> gets the value
|
||||
<literal>pkgs.gtk3</literal>, causing Emacs to depend on GTK 3. (The
|
||||
parentheses are necessary because in Nix, function application binds
|
||||
more weakly than list construction, so without them,
|
||||
<xref linkend="opt-environment.systemPackages" /> would be a list
|
||||
with two elements.)
|
||||
</para>
|
||||
<para>
|
||||
Even greater customisation is possible using the function
|
||||
<literal>overrideAttrs</literal>. While the
|
||||
<literal>override</literal> mechanism above overrides the arguments
|
||||
of a package function, <literal>overrideAttrs</literal> allows
|
||||
changing the <emphasis>attributes</emphasis> passed to
|
||||
<literal>mkDerivation</literal>. This permits changing any aspect of
|
||||
the package, such as the source code. For instance, if you want to
|
||||
override the source code of Emacs, you can say:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
environment.systemPackages = [
|
||||
(pkgs.emacs.overrideAttrs (oldAttrs: {
|
||||
name = "emacs-25.0-pre";
|
||||
src = /path/to/my/emacs/tree;
|
||||
}))
|
||||
];
|
||||
</programlisting>
|
||||
<para>
|
||||
Here, <literal>overrideAttrs</literal> takes the Nix derivation
|
||||
specified by <literal>pkgs.emacs</literal> and produces a new
|
||||
derivation in which the original’s <literal>name</literal> and
|
||||
<literal>src</literal> attribute have been replaced by the given
|
||||
values by re-calling <literal>stdenv.mkDerivation</literal>. The
|
||||
original attributes are accessible via the function argument, which
|
||||
is conventionally named <literal>oldAttrs</literal>.
|
||||
</para>
|
||||
<para>
|
||||
The overrides shown above are not global. They do not affect the
|
||||
original package; other packages in Nixpkgs continue to depend on
|
||||
the original rather than the customised package. This means that if
|
||||
another package in your system depends on the original package, you
|
||||
end up with two instances of the package. If you want to have
|
||||
everything depend on your customised instance, you can apply a
|
||||
<emphasis>global</emphasis> override as follows:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
nixpkgs.config.packageOverrides = pkgs:
|
||||
{ emacs = pkgs.emacs.override { gtk = pkgs.gtk3; };
|
||||
};
|
||||
</programlisting>
|
||||
<para>
|
||||
The effect of this definition is essentially equivalent to modifying
|
||||
the <literal>emacs</literal> attribute in the Nixpkgs source tree.
|
||||
Any package in Nixpkgs that depends on <literal>emacs</literal> will
|
||||
be passed your customised instance. (However, the value
|
||||
<literal>pkgs.emacs</literal> in
|
||||
<literal>nixpkgs.config.packageOverrides</literal> refers to the
|
||||
original rather than overridden instance, to prevent an infinite
|
||||
recursion.)
|
||||
</para>
|
||||
</section>
|
||||
@@ -1,53 +0,0 @@
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="sec-declarative-package-mgmt">
|
||||
<title>Declarative Package Management</title>
|
||||
<para>
|
||||
With declarative package management, you specify which packages you
|
||||
want on your system by setting the option
|
||||
<xref linkend="opt-environment.systemPackages" />. For instance,
|
||||
adding the following line to <literal>configuration.nix</literal>
|
||||
enables the Mozilla Thunderbird email application:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
environment.systemPackages = [ pkgs.thunderbird ];
|
||||
</programlisting>
|
||||
<para>
|
||||
The effect of this specification is that the Thunderbird package
|
||||
from Nixpkgs will be built or downloaded as part of the system when
|
||||
you run <literal>nixos-rebuild switch</literal>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Some packages require additional global configuration such as
|
||||
D-Bus or systemd service registration so adding them to
|
||||
<xref linkend="opt-environment.systemPackages" /> might not be
|
||||
sufficient. You are advised to check the
|
||||
<link linkend="ch-options">list of options</link> whether a NixOS
|
||||
module for the package does not exist.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
You can get a list of the available packages as follows:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ nix-env -qaP '*' --description
|
||||
nixos.firefox firefox-23.0 Mozilla Firefox - the browser, reloaded
|
||||
...
|
||||
</programlisting>
|
||||
<para>
|
||||
The first column in the output is the <emphasis>attribute
|
||||
name</emphasis>, such as <literal>nixos.thunderbird</literal>.
|
||||
</para>
|
||||
<para>
|
||||
Note: the <literal>nixos</literal> prefix tells us that we want to
|
||||
get the package from the <literal>nixos</literal> channel and works
|
||||
only in CLI tools. In declarative configuration use
|
||||
<literal>pkgs</literal> prefix (variable).
|
||||
</para>
|
||||
<para>
|
||||
To <quote>uninstall</quote> a package, simply remove it from
|
||||
<xref linkend="opt-environment.systemPackages" /> and run
|
||||
<literal>nixos-rebuild switch</literal>.
|
||||
</para>
|
||||
<xi:include href="customizing-packages.section.xml" />
|
||||
<xi:include href="adding-custom-packages.section.xml" />
|
||||
</section>
|
||||
@@ -1,55 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="ch-file-systems">
|
||||
<title>File Systems</title>
|
||||
<para>
|
||||
You can define file systems using the <literal>fileSystems</literal>
|
||||
configuration option. For instance, the following definition causes
|
||||
NixOS to mount the Ext4 file system on device
|
||||
<literal>/dev/disk/by-label/data</literal> onto the mount point
|
||||
<literal>/data</literal>:
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
fileSystems."/data" =
|
||||
{ device = "/dev/disk/by-label/data";
|
||||
fsType = "ext4";
|
||||
};
|
||||
</programlisting>
|
||||
<para>
|
||||
This will create an entry in <literal>/etc/fstab</literal>, which
|
||||
will generate a corresponding
|
||||
<link xlink:href="https://www.freedesktop.org/software/systemd/man/systemd.mount.html">systemd.mount</link>
|
||||
unit via
|
||||
<link xlink:href="https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html">systemd-fstab-generator</link>.
|
||||
The filesystem will be mounted automatically unless
|
||||
<literal>"noauto"</literal> is present in
|
||||
<link linkend="opt-fileSystems._name_.options">options</link>.
|
||||
<literal>"noauto"</literal> filesystems can be mounted
|
||||
explicitly using <literal>systemctl</literal> e.g.
|
||||
<literal>systemctl start data.mount</literal>. Mount points are
|
||||
created automatically if they don’t already exist. For
|
||||
<literal>device</literal>, it’s best to use the topology-independent
|
||||
device aliases in <literal>/dev/disk/by-label</literal> and
|
||||
<literal>/dev/disk/by-uuid</literal>, as these don’t change if the
|
||||
topology changes (e.g. if a disk is moved to another IDE
|
||||
controller).
|
||||
</para>
|
||||
<para>
|
||||
You can usually omit the file system type
|
||||
(<literal>fsType</literal>), since <literal>mount</literal> can
|
||||
usually detect the type and load the necessary kernel module
|
||||
automatically. However, if the file system is needed at early boot
|
||||
(in the initial ramdisk) and is not <literal>ext2</literal>,
|
||||
<literal>ext3</literal> or <literal>ext4</literal>, then it’s best
|
||||
to specify <literal>fsType</literal> to ensure that the kernel
|
||||
module is available.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
System startup will fail if any of the filesystems fails to mount,
|
||||
dropping you to the emergency shell. You can make a mount
|
||||
asynchronous and non-critical by adding
|
||||
<literal>options = [ "nofail" ];</literal>.
|
||||
</para>
|
||||
</note>
|
||||
<xi:include href="luks-file-systems.section.xml" />
|
||||
<xi:include href="sshfs-file-systems.section.xml" />
|
||||
</chapter>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user