mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Merge remote-tracking branch 'origin/master' into lazy-trees
This commit is contained in:
commit
fcdca3d776
65 changed files with 1366 additions and 1205 deletions
|
@ -1,16 +1,20 @@
|
|||
with builtins;
|
||||
with import ./utils.nix;
|
||||
builtinsDump:
|
||||
let
|
||||
showBuiltin = name:
|
||||
let
|
||||
inherit (builtinsDump.${name}) doc args;
|
||||
in
|
||||
''
|
||||
<dt id="builtins-${name}">
|
||||
<a href="#builtins-${name}"><code>${name} ${listArgs args}</code></a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
builtins:
|
||||
${doc}
|
||||
|
||||
</dd>
|
||||
'';
|
||||
listArgs = args: builtins.concatStringsSep " " (map (s: "<var>${s}</var>") args);
|
||||
in
|
||||
with builtins; concatStringsSep "\n" (map showBuiltin (attrNames builtinsDump))
|
||||
|
||||
concatStrings (map
|
||||
(name:
|
||||
let builtin = builtins.${name}; in
|
||||
"<dt id=\"builtins-${name}\"><a href=\"#builtins-${name}\"><code>${name} "
|
||||
+ concatStringsSep " " (map (s: "<var>${s}</var>") builtin.args)
|
||||
+ "</code></a></dt>"
|
||||
+ "<dd>\n\n"
|
||||
+ builtin.doc
|
||||
+ "\n\n</dd>"
|
||||
)
|
||||
(attrNames builtins))
|
||||
|
|
|
@ -99,6 +99,7 @@ let
|
|||
in [ cmd ] ++ concatMap subcommand (attrNames details.commands or {});
|
||||
|
||||
parsedToplevel = builtins.fromJSON toplevel;
|
||||
|
||||
manpages = processCommand {
|
||||
command = "nix";
|
||||
details = parsedToplevel;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
The easiest way to install Nix is to run the following command:
|
||||
|
||||
```console
|
||||
$ sh <(curl -L https://nixos.org/nix/install)
|
||||
sh <(curl -L https://nixos.org/nix/install)
|
||||
```
|
||||
|
||||
This will run the installer interactively (causing it to explain what
|
||||
|
@ -27,7 +27,7 @@ you can authenticate with `sudo`.
|
|||
To explicitly select a single-user installation on your system:
|
||||
|
||||
```console
|
||||
$ sh <(curl -L https://nixos.org/nix/install) --no-daemon
|
||||
sh <(curl -L https://nixos.org/nix/install) --no-daemon
|
||||
```
|
||||
|
||||
This will perform a single-user installation of Nix, meaning that `/nix`
|
||||
|
@ -37,8 +37,8 @@ if it doesn’t already exist. If you don’t have `sudo`, you should
|
|||
manually create `/nix` first as root, e.g.:
|
||||
|
||||
```console
|
||||
$ mkdir /nix
|
||||
$ chown alice /nix
|
||||
mkdir /nix
|
||||
chown alice /nix
|
||||
```
|
||||
|
||||
The install script will modify the first writable file from amongst
|
||||
|
@ -50,7 +50,7 @@ the install script to disable this behaviour.
|
|||
You can uninstall Nix simply by running:
|
||||
|
||||
```console
|
||||
$ rm -rf /nix
|
||||
rm -rf /nix
|
||||
```
|
||||
|
||||
# Multi User Installation
|
||||
|
@ -66,7 +66,7 @@ You can instruct the installer to perform a multi-user installation on
|
|||
your system:
|
||||
|
||||
```console
|
||||
$ sh <(curl -L https://nixos.org/nix/install) --daemon
|
||||
sh <(curl -L https://nixos.org/nix/install) --daemon
|
||||
```
|
||||
|
||||
The multi-user installation of Nix will create build users between the
|
||||
|
@ -274,7 +274,7 @@ These install scripts can be used the same as the main NixOS.org
|
|||
installation script:
|
||||
|
||||
```console
|
||||
$ sh <(curl -L https://nixos.org/nix/install)
|
||||
sh <(curl -L https://nixos.org/nix/install)
|
||||
```
|
||||
|
||||
In the same directory of the install script are sha256 sums, and gpg
|
||||
|
@ -289,10 +289,10 @@ it somewhere (e.g. in `/tmp`), and then run the script named `install`
|
|||
inside the binary tarball:
|
||||
|
||||
```console
|
||||
$ cd /tmp
|
||||
$ tar xfj nix-1.8-x86_64-darwin.tar.bz2
|
||||
$ cd nix-1.8-x86_64-darwin
|
||||
$ ./install
|
||||
cd /tmp
|
||||
tar xfj nix-1.8-x86_64-darwin.tar.bz2
|
||||
cd nix-1.8-x86_64-darwin
|
||||
./install
|
||||
```
|
||||
|
||||
If you need to edit the multi-user installation script to use different
|
||||
|
|
|
@ -93,7 +93,7 @@ This is an incomplete overview of language features, by example.
|
|||
|
||||
`"hello ${ { a = "world" }.a }"`
|
||||
|
||||
`"1 2 ${3}"`
|
||||
`"1 2 ${toString 3}"`
|
||||
|
||||
`"${pkgs.bash}/bin/sh"`
|
||||
|
||||
|
|
|
@ -11,6 +11,48 @@
|
|||
a context just because they are read from a store path
|
||||
([#7260](https://github.com/NixOS/nix/pull/7260)).
|
||||
|
||||
* Nix can now automatically pick UIDs for builds, removing the need to
|
||||
create `nixbld*` user accounts. These UIDs are allocated starting at
|
||||
872415232 (0x34000000) on Linux and 56930 on macOS.
|
||||
|
||||
This is an experimental feature. To enable it, add the following to
|
||||
`nix.conf`:
|
||||
|
||||
```
|
||||
extra-experimental-features = auto-allocate-uids
|
||||
auto-allocate-uids = true
|
||||
```
|
||||
|
||||
* On Linux, Nix can now run builds in a user namespace where the build
|
||||
runs as root (UID 0) and has 65,536 UIDs available. This is
|
||||
primarily useful for running containers such as `systemd-nspawn`
|
||||
inside a Nix build. For an example, see
|
||||
https://github.com/NixOS/nix/blob/67bcb99700a0da1395fa063d7c6586740b304598/tests/systemd-nspawn.nix.
|
||||
|
||||
A build can enable this by requiring the `uid-range` system feature,
|
||||
i.e. by setting the derivation attribute
|
||||
|
||||
```
|
||||
requiredSystemFeatures = [ "uid-range" ];
|
||||
```
|
||||
|
||||
The `uid-range` system feature requires the `auto-allocate-uids`
|
||||
setting to be enabled (see above).
|
||||
|
||||
* On Linux, Nix has experimental support for running builds inside a
|
||||
cgroup. It can be enabled by adding
|
||||
|
||||
```
|
||||
extra-experimental-features = cgroups
|
||||
use-cgroups = true
|
||||
```
|
||||
|
||||
to `nix.conf`. Cgroups are required for derivations that require the
|
||||
`uid-range` system feature.
|
||||
|
||||
* `nix build --json` now prints some statistics about top-level
|
||||
derivations, such as CPU statistics when cgroups are enabled.
|
||||
|
||||
* You can now use flake references in the old CLI, e.g.
|
||||
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue