1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 21:51:50 +02:00

document all special system features and their behavior

This commit is contained in:
Valentin Gagarin 2023-07-19 11:57:20 +02:00
parent 493ddf617f
commit 5f37ebcf83
3 changed files with 41 additions and 24 deletions

View file

@ -2,20 +2,8 @@
* On Linux, Nix can now run builds in a user namespace where they run
as root (UID 0) and have 65,536 UIDs available.
<!-- FIXME: move this to its own section about system features -->
This is primarily useful for running containers such as `systemd-nspawn`
inside a Nix build. For an example, see [`tests/systemd-nspawn/nix`][nspawn].
[nspawn]: https://github.com/NixOS/nix/blob/67bcb99700a0da1395fa063d7c6586740b304598/tests/systemd-nspawn.nix.
A build can enable this by setting the derivation attribute:
```
requiredSystemFeatures = [ "uid-range" ];
```
The `uid-range` [system feature] requires the [`auto-allocate-uids`]
setting to be enabled.
This can be used by requiring `uid-range` [system feature] in derivations.
[system feature]: ../command-ref/conf-file.md#conf-system-features