You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The subject is considered controversial among Nix users and developers in terms of design, development processes, and community governance.
20
20
In particular:
21
21
- The RFC was closed without conclusion, and some design and implementation issues are not yet resolved.
22
22
Examples include the notion of a global [flake registry], the [impossibility of parameterising flakes](https://github.com/NixOS/nix/issues/2861), and the [new command line interface and flakes being closely tied to each other](https://discourse.nixos.org/t/2023-03-06-nix-team-meeting-minutes-38/26056#cli-stabilisation-announcement-draft-4).
23
-
- The original implementation introduced [regressions](https://discourse.nixos.org/t/nix-2-4-and-what-s-next/16257) in the [Nix 2.4 release](https://nixos.org/manual/nix/stable/release-notes/rl-2.4.html), breaking some stable functionality without a [major version](https://semver.org/) increment.
23
+
- The original implementation introduced [regressions](https://discourse.nixos.org/t/nix-2-4-and-what-s-next/16257) in the [Nix 2.4 release](https://nix.dev/manual/nix/2.17/release-notes/rl-2.4.html), breaking some stable functionality without a [major version](https://semver.org/) increment.
24
24
- New Nix users were and still are encouraged by various individuals to adopt flakes despite there being no concrete plan or timeline for stabilisation.
This led to a situation where the stable interface was only sparsely maintained for multiple years, and repeatedly suffered breakages due to ongoing development.
29
29
Meanwhile, the new interface was adopted widely enough for evolving its design without negatively affecting users to become very challenging.
@@ -50,7 +50,7 @@ Both paradigms have their own set of unique concepts and support tooling that ha
50
50
At the moment, neither the stable nor the experimental interface is clearly superior to the other in all aspects.
51
51
While flakes reduce complexity in some regards, they also introduce additional mechanisms and you will have to learn more about the system to fully understand how it works.
52
52
53
-
There are downsides to relying on [experimental features](https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-experimental-features) in general:
53
+
There are downsides to relying on [experimental features](https://nix.dev/manual/nix/2.17/command-ref/conf-file.html#conf-experimental-features) in general:
54
54
55
55
- Interfaces and behaviour of experimental features could still be changed by Nix developers.
56
56
This may require you to adapt your code at some point in the future, which will be more effort when it has grown in complexity.
@@ -96,7 +96,7 @@ Yes. There is:
96
96
97
97
- CPU architecture—great effort being made to avoid compilation of native instructions in favour of hardcoded supported ones.
98
98
- System's current time/date.
99
-
- The filesystem used for building (see also [`TMPDIR`](https://nixos.org/manual/nix/stable/command-ref/env-common.html#env-TMPDIR)).
99
+
- The filesystem used for building (see also [`TMPDIR`](https://nix.dev/manual/nix/2.17/command-ref/env-common.html#env-TMPDIR)).
Technically, a [flake](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#description) is a file system tree that contains a file named `flake.nix` in its root directory.
10
+
Technically, a [flake](https://nix.dev/manual/nix/2.17/command-ref/new-cli/nix3-flake.html#description) is a file system tree that contains a file named `flake.nix` in its root directory.
11
11
12
12
Flakes add the following behavior to Nix:
13
13
14
-
1. A `flake.nix` file offers a uniform [schema](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-format) , where:
14
+
1. A `flake.nix` file offers a uniform [schema](https://nix.dev/manual/nix/2.17/command-ref/new-cli/nix3-flake.html#flake-format) , where:
15
15
- Other flakes can be referenced as dependencies providing {term}`Nix language` code or other files.
16
16
- The values produced by the {term}`Nix expression`s in `flake.nix` are structured according to pre-defined use cases.
17
17
18
-
1. References to other flakes can be specified using a dedicated [URL-like syntax](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-references).
18
+
1. References to other flakes can be specified using a dedicated [URL-like syntax](https://nix.dev/manual/nix/2.17/command-ref/new-cli/nix3-flake.html#flake-references).
19
19
A [flake registry] allows using symbolic identifiers for further brevity.
20
20
References can be automatically locked to their current specific version and later updated programmatically.
1. A [new command line interface], implemented as a separate experimental feature, leverages flakes by accepting flake references in order to build, run, or deploy software defined as a flake.
25
25
26
-
[new command line interface]: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix.html
26
+
[new command line interface]: https://nix.dev/manual/nix/2.17/command-ref/new-cli/nix.html
27
27
28
28
Nix handles flakes differently than regular {term}`Nix file`s in the following ways:
This means, the value of a lookup path depends on external system state.
125
125
When using lookup paths, the same Nix expression can produce different results.
126
126
127
127
In most cases, `$NIX_PATH` is set to the latest channel when Nix is installed, and is therefore likely to differ from machine to machine.
128
128
129
129
:::{note}
130
-
[Channels](https://nixos.org/manual/nix/stable/command-ref/nix-channel.html) are a mechanism for referencing remote Nix expressions and retrieving their latest version.
130
+
[Channels](https://nix.dev/manual/nix/2.17/command-ref/nix-channel.html) are a mechanism for referencing remote Nix expressions and retrieving their latest version.
131
131
:::
132
132
133
133
The state of a subscribed channel is external to the Nix expressions relying on it.
@@ -184,7 +184,7 @@ We skip it in minimal examples reduce distractions.
184
184
185
185
## Updating nested attribute sets
186
186
187
-
The [attribute set update operator](https://nixos.org/manual/nix/stable/language/operators.html#update) merges two attribute sets.
187
+
The [attribute set update operator](https://nix.dev/manual/nix/2.17/language/operators.html#update) merges two attribute sets.
188
188
189
189
Example:
190
190
@@ -250,7 +250,7 @@ If someone builds the project in a directory with a different name, they will ge
250
250
This can be the cause of needless rebuilds.
251
251
252
252
:::{tip}
253
-
Use [`builtins.path`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-path) with the `name` attribute set to something fixed.
253
+
Use [`builtins.path`](https://nix.dev/manual/nix/2.17/language/builtins.html#builtins-path) with the `name` attribute set to something fixed.
254
254
255
255
This will derive the symbolic name of the store path from `name` instead of the working directory:
This is a [known issue](https://github.com/NixOS/nix/issues/1251).
27
27
28
-
It means that using a new version of Nix upgraded the SQLite schema of the [database](https://nixos.org/manual/nix/stable/glossary#gloss-nix-database), and then you tried to use an older version Nix.
28
+
It means that using a new version of Nix upgraded the SQLite schema of the [database](https://nix.dev/manual/nix/2.17/glossary#gloss-nix-database), and then you tried to use an older version Nix.
29
29
30
30
The solution is to dump the database, use the old Nix version to initialize it, and then re-import the data:
### How to fix: `writing to file: Connection reset by peer`
41
41
42
-
This may mean you are trying to import a too large file or directory into the [Nix store](https://nixos.org/manual/nix/stable/glossary#gloss-store), or your machine is running out of resources, such as disk space or memory.
42
+
This may mean you are trying to import a too large file or directory into the [Nix store](https://nix.dev/manual/nix/2.17/glossary#gloss-store), or your machine is running out of resources, such as disk space or memory.
43
43
44
-
Try to reduce the size of the directory to import, or run [garbage collection](https://nixos.org/manual/nix/stable/command-ref/nix-collect-garbage).
44
+
Try to reduce the size of the directory to import, or run [garbage collection](https://nix.dev/manual/nix/2.17/command-ref/nix-collect-garbage).
-[`-I` option](https://nixos.org/manual/nix/stable/command-ref/opt-common.html#opt-I) to most of commands like `nix-build`, `nix-shell`, etc.
9
-
-[`fetchurl`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchurl), [`fetchTarball`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchTarball), [`fetchGit`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchGit) or [Nixpkgs fetchers](https://nixos.org/manual/nixpkgs/stable/#chap-pkgs-fetchers) in Nix expressions
-[`-I` option](https://nix.dev/manual/nix/2.17/command-ref/opt-common.html#opt-I) to most of commands like `nix-build`, `nix-shell`, etc.
9
+
-[`fetchurl`](https://nix.dev/manual/nix/2.17/language/builtins.html#builtins-fetchurl), [`fetchTarball`](https://nix.dev/manual/nix/2.17/language/builtins.html#builtins-fetchTarball), [`fetchGit`](https://nix.dev/manual/nix/2.17/language/builtins.html#builtins-fetchGit) or [Nixpkgs fetchers](https://nixos.org/manual/nixpkgs/stable/#chap-pkgs-fetchers) in Nix expressions
0 commit comments