diff --git a/.mergify.yml b/.mergify.yml index e134b0f46..36ffe6e8b 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -128,3 +128,14 @@ pull_request_rules: labels: - automatic backport - merge-queue + + - name: backport patches to 2.28 + conditions: + - label=backport 2.28-maintenance + actions: + backport: + branches: + - "2.28-maintenance" + labels: + - automatic backport + - merge-queue diff --git a/.version b/.version index 1eb56ea3a..f01356823 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.28.3 +2.29.0 diff --git a/.version-determinate b/.version-determinate index 87ce49290..9575d51ba 100644 --- a/.version-determinate +++ b/.version-determinate @@ -1 +1 @@ -3.5.2 +3.6.1 diff --git a/doc/manual/generate-deps.py b/doc/manual/generate-deps.py index 297bd3939..8d6b5a267 100755 --- a/doc/manual/generate-deps.py +++ b/doc/manual/generate-deps.py @@ -14,7 +14,7 @@ import sys # literally. since the rules for these aren't even the same for # all three we will just fail when we encounter any of them (if # asserts are off for some reason the depfile will likely point -# to nonexistant paths, making everything phony and thus fine.) +# to nonexistent paths, making everything phony and thus fine.) for path in glob.glob(sys.argv[1] + '/**', recursive=True): assert '\\' not in path assert ' ' not in path diff --git a/doc/manual/generate-store-info.nix b/doc/manual/generate-store-info.nix index e8b7377da..e66611aff 100644 --- a/doc/manual/generate-store-info.nix +++ b/doc/manual/generate-store-info.nix @@ -33,6 +33,7 @@ let { settings, doc, + uri-schemes, experimentalFeature, }: let diff --git a/doc/manual/meson.build b/doc/manual/meson.build index 2146d73ef..c8a5282aa 100644 --- a/doc/manual/meson.build +++ b/doc/manual/meson.build @@ -69,7 +69,7 @@ subdir('source/release-notes') subdir('source') # Hacky way to figure out if `nix` is an `ExternalProgram` or -# `Exectuable`. Only the latter can occur in custom target input lists. +# `Executable`. Only the latter can occur in custom target input lists. if nix.full_path().startswith(meson.build_root()) nix_input = nix else diff --git a/doc/manual/package.nix b/doc/manual/package.nix index 778440ac2..3953cb861 100644 --- a/doc/manual/package.nix +++ b/doc/manual/package.nix @@ -11,6 +11,8 @@ python3, rsync, nix-cli, + changelog-d, + officialRelease, # Configuration Options @@ -45,16 +47,24 @@ mkMesonDerivation (finalAttrs: { ]; # Hack for sake of the dev shell - passthru.externalNativeBuildInputs = [ - meson - ninja - (lib.getBin lowdown-unsandboxed) - mdbook - mdbook-linkcheck - jq - python3 - rsync - ]; + passthru.externalNativeBuildInputs = + [ + meson + ninja + (lib.getBin lowdown-unsandboxed) + mdbook + mdbook-linkcheck + jq + python3 + rsync + changelog-d + ] + ++ lib.optionals (!officialRelease) [ + # When not an official release, we likely have changelog entries that have + # yet to be rendered. + # When released, these are rendered into a committed file to save a dependency. + changelog-d + ]; nativeBuildInputs = finalAttrs.passthru.externalNativeBuildInputs ++ [ nix-cli diff --git a/doc/manual/redirects.js b/doc/manual/redirects.js index 3648ad898..b2295cf4f 100644 --- a/doc/manual/redirects.js +++ b/doc/manual/redirects.js @@ -370,6 +370,7 @@ const redirects = { }, "glossary.html": { "gloss-local-store": "store/types/local-store.html", + "package-attribute-set": "#package", "gloss-chroot-store": "store/types/local-store.html", "gloss-content-addressed-derivation": "#gloss-content-addressing-derivation", }, diff --git a/doc/manual/source/SUMMARY.md.in b/doc/manual/source/SUMMARY.md.in index a7ed52a23..addcd106b 100644 --- a/doc/manual/source/SUMMARY.md.in +++ b/doc/manual/source/SUMMARY.md.in @@ -28,6 +28,7 @@ - [Data Types](language/types.md) - [String context](language/string-context.md) - [Syntax and semantics](language/syntax.md) + - [Evaluation](language/evaluation.md) - [Variables](language/variables.md) - [String literals](language/string-literals.md) - [Identifiers](language/identifiers.md) @@ -128,6 +129,8 @@ - [Contributing](development/contributing.md) - [Determinate Nix Release Notes](release-notes-determinate/index.md) - [Changes between Nix and Determinate Nix](release-notes-determinate/changes.md) + - [Release 3.6.1 (2025-05-24)](release-notes-determinate/rl-3.6.1.md) + - [Release 3.6.0 (2025-05-22)](release-notes-determinate/rl-3.6.0.md) - [Release 3.5.2 (2025-05-12)](release-notes-determinate/rl-3.5.2.md) - [Release 3.5.1 (2025-05-09)](release-notes-determinate/rl-3.5.1.md) - [~~Release 3.5.0 (2025-05-09)~~](release-notes-determinate/rl-3.5.0.md) @@ -138,6 +141,7 @@ - [Release 3.0.0 (2025-03-04)](release-notes-determinate/rl-3.0.0.md) - [Nix Release Notes](release-notes/index.md) {{#include ./SUMMARY-rl-next.md}} + - [Release 2.29 (2025-05-14)](release-notes/rl-2.29.md) - [Release 2.28 (2025-04-02)](release-notes/rl-2.28.md) - [Release 2.27 (2025-03-03)](release-notes/rl-2.27.md) - [Release 2.26 (2025-01-22)](release-notes/rl-2.26.md) diff --git a/doc/manual/source/advanced-topics/distributed-builds.md b/doc/manual/source/advanced-topics/distributed-builds.md index 464b87d6e..08a980643 100644 --- a/doc/manual/source/advanced-topics/distributed-builds.md +++ b/doc/manual/source/advanced-topics/distributed-builds.md @@ -27,7 +27,7 @@ nix store info --store ssh://username@mac ``` To specify an SSH identity file as part of the remote store URI add a -query paramater, e.g. +query parameter, e.g. ```console nix store info --store ssh://username@mac?ssh-key=/home/alice/my-key diff --git a/doc/manual/source/architecture/architecture.md b/doc/manual/source/architecture/architecture.md index cbc469355..0c8677a6a 100644 --- a/doc/manual/source/architecture/architecture.md +++ b/doc/manual/source/architecture/architecture.md @@ -22,9 +22,9 @@ The following [concept map] shows its main components (rectangles), the objects | | +----------|-------------------|--------------------------------+ | Nix | V | -| | +-------------------------+ | -| | | commmand line interface |------. | -| | +-------------------------+ | | +| | +------------------------+ | +| | | command line interface |------. | +| | +------------------------+ | | | | | | | | evaluated by calls manages | | | | | | diff --git a/doc/manual/source/command-ref/nix-env/delete-generations.md b/doc/manual/source/command-ref/nix-env/delete-generations.md index b1ff0bb69..b769790fd 100644 --- a/doc/manual/source/command-ref/nix-env/delete-generations.md +++ b/doc/manual/source/command-ref/nix-env/delete-generations.md @@ -27,7 +27,7 @@ This operation deletes the specified generations of the current profile. > > Older *and newer* generations will be deleted by this operation. > - > One might expect this to just delete older generations than the curent one, but that is only true if the current generation is also the latest. + > One might expect this to just delete older generations than the current one, but that is only true if the current generation is also the latest. > Because one can roll back to a previous generation, it is possible to have generations newer than the current one. > They will also be deleted. diff --git a/doc/manual/source/command-ref/nix-shell.md b/doc/manual/source/command-ref/nix-shell.md index e95db9bea..f2e2e3593 100644 --- a/doc/manual/source/command-ref/nix-shell.md +++ b/doc/manual/source/command-ref/nix-shell.md @@ -242,16 +242,21 @@ print(t) ``` Similarly, the following is a Perl script that specifies that it -requires Perl and the `HTML::TokeParser::Simple` and `LWP` packages: +requires Perl and the `HTML::TokeParser::Simple`, `LWP` and +`LWP::Protocol::Https` packages: ```perl #! /usr/bin/env nix-shell -#! nix-shell -i perl --packages perl perlPackages.HTMLTokeParserSimple perlPackages.LWP +#! nix-shell -i perl +#! nix-shell --packages perl +#! nix-shell --packages perlPackages.HTMLTokeParserSimple +#! nix-shell --packages perlPackages.LWP +#! nix-shell --packages perlPackages.LWPProtocolHttps use HTML::TokeParser::Simple; # Fetch nixos.org and print all hrefs. -my $p = HTML::TokeParser::Simple->new(url => 'http://nixos.org/'); +my $p = HTML::TokeParser::Simple->new(url => 'https://nixos.org/'); while (my $token = $p->get_tag("a")) { my $href = $token->get_attr("href"); @@ -316,7 +321,7 @@ contains: ```nix with import {}; -runCommand "dummy" { buildInputs = [ python pythonPackages.prettytable ]; } "" +runCommand "dummy" { buildInputs = [ python3 python3Packages.prettytable ]; } "" ``` The script's file name is passed as the first argument to the interpreter specified by the `-i` flag. diff --git a/doc/manual/source/command-ref/nix-store/query.md b/doc/manual/source/command-ref/nix-store/query.md index 601f46af6..94eee05b8 100644 --- a/doc/manual/source/command-ref/nix-store/query.md +++ b/doc/manual/source/command-ref/nix-store/query.md @@ -45,10 +45,19 @@ symlink. [output paths]: @docroot@/glossary.md#gloss-output-path +- `--references` + + Prints the set of [references] of the store paths + *paths*, that is, their immediate dependencies. (For *all* + dependencies, use `--requisites`.) + + [references]: @docroot@/glossary.md#gloss-reference + - `--requisites` / `-R` - Prints out the [closure] of the store path *paths*. + Prints out the set of [*requisites*][requisite] (better known as the [closure]) of the store path *paths*. + [requisite]: @docroot@/glossary.md#gloss-requisite [closure]: @docroot@/glossary.md#gloss-closure This query has one option: @@ -65,29 +74,25 @@ symlink. dependencies) is obtained by distributing the closure of a store derivation and specifying the option `--include-outputs`. -- `--references` - - Prints the set of [references] of the store paths - *paths*, that is, their immediate dependencies. (For *all* - dependencies, use `--requisites`.) - - [references]: @docroot@/glossary.md#gloss-reference - - `--referrers` - Prints the set of *referrers* of the store paths *paths*, that is, + Prints the set of [*referrers*][referrer] of the store paths *paths*, that is, the store paths currently existing in the Nix store that refer to one of *paths*. Note that contrary to the references, the set of referrers is not constant; it can change as store paths are added or removed. + [referrer]: @docroot@/glossary.md#gloss-referrer + - `--referrers-closure` Prints the closure of the set of store paths *paths* under the - referrers relation; that is, all store paths that directly or + [referrers relation][referrer]; that is, all store paths that directly or indirectly refer to one of *paths*. These are all the path currently in the Nix store that are dependent on *paths*. + [referrer]: @docroot@/glossary.md#gloss-referrer + - `--deriver` / `-d` Prints the [deriver] that was used to build the store paths *paths*. If @@ -98,6 +103,13 @@ symlink. example when *paths* were substituted from a binary cache. Use `--valid-derivers` instead to obtain valid paths only. + > **Note** + > + > `nix-store --query --deriver` is replaced with the following `nix` command: + > + > nix path-info --json ... | jq -r '.[].deriver' + + [deriver]: @docroot@/glossary.md#gloss-deriver - `--valid-derivers` diff --git a/doc/manual/source/development/building.md b/doc/manual/source/development/building.md index 49cc9d568..bf2f73c10 100644 --- a/doc/manual/source/development/building.md +++ b/doc/manual/source/development/building.md @@ -121,19 +121,25 @@ Nix uses a string with the following format to identify the *system type* or *pl -[-] ``` -It is set when Nix is compiled for the given system, and based on the output of [`config.guess`](https://github.com/nixos/nix/blob/master/config/config.guess) ([upstream](https://git.savannah.gnu.org/cgit/config.git/tree/config.guess)): +It is set when Nix is compiled for the given system, and based on the output of Meson's [`host_machine` information](https://mesonbuild.com/Reference-manual_builtin_host_machine.html)> ``` --[][-] ``` -When Nix is built such that `./configure` is passed any of the `--host`, `--build`, `--target` options, the value is based on the output of [`config.sub`](https://github.com/nixos/nix/blob/master/config/config.sub) ([upstream](https://git.savannah.gnu.org/cgit/config.git/tree/config.sub)): +When cross-compiling Nix with Meson for local development, you need to specify a [cross-file](https://mesonbuild.com/Cross-compilation.html) using the `--cross-file` option. Cross-files define the target architecture and toolchain. When cross-compiling Nix with Nix, Nixpkgs takes care of this for you. + +In the nix flake we also have some cross-compilation targets available: ``` --[-]- +nix build .#nix-everything-riscv64-unknown-linux-gnu +nix build .#nix-everything-armv7l-unknown-linux-gnueabihf +nix build .#nix-everything-armv7l-unknown-linux-gnueabihf +nix build .#nix-everything-x86_64-unknown-freebsd +nix build .#nix-everything-x86_64-w64-mingw32 ``` -For historic reasons and backward-compatibility, some CPU and OS identifiers are translated from the GNU Autotools naming convention in [`configure.ac`](https://github.com/nixos/nix/blob/master/configure.ac) as follows: +For historic reasons and backward-compatibility, some CPU and OS identifiers are translated as follows: | `config.guess` | Nix | |----------------------------|---------------------| @@ -156,10 +162,10 @@ Nix can be compiled using multiple environments: To build with one of those environments, you can use ```console -$ nix build .#nix-ccacheStdenv +$ nix build .#nix-cli-ccacheStdenv ``` -You can use any of the other supported environments in place of `nix-ccacheStdenv`. +You can use any of the other supported environments in place of `nix-cli-ccacheStdenv`. ## Editor integration diff --git a/doc/manual/source/development/cli-guideline.md b/doc/manual/source/development/cli-guideline.md index 23df844ec..052b4aae8 100644 --- a/doc/manual/source/development/cli-guideline.md +++ b/doc/manual/source/development/cli-guideline.md @@ -170,9 +170,9 @@ sensitive. ```shell -$ nix init --template=template#pyton +$ nix init --template=template#python ------------------------------------------------------------------------ - Error! Template `template#pyton` not found. + Error! Template `template#python` not found. ------------------------------------------------------------------------ Initializing Nix project at `/path/to/here`. Select a template for you new project: diff --git a/doc/manual/source/development/contributing.md b/doc/manual/source/development/contributing.md index 7de7489dc..5c32aeb71 100644 --- a/doc/manual/source/development/contributing.md +++ b/doc/manual/source/development/contributing.md @@ -20,8 +20,9 @@ prs: 1238 Here's one or more paragraphs that describe the change. - It's markdown -- Add references to the manual using @docroot@ +- Add references to the manual using [links like this](@_at_docroot@/example.md) ``` + Significant changes should add the following header, which moves them to the top. diff --git a/doc/manual/source/glossary.md b/doc/manual/source/glossary.md index 6a7501200..94a6b5825 100644 --- a/doc/manual/source/glossary.md +++ b/doc/manual/source/glossary.md @@ -38,6 +38,13 @@ [store derivation]: #gloss-store-derivation +- [directed acyclic graph]{#gloss-directed-acyclic-graph} + + A [directed acyclic graph](https://en.wikipedia.org/wiki/Directed_acyclic_graph) (DAG) is graph whose edges are given a direction ("a to b" is not the same edge as "b to a"), and for which no possible path (created by joining together edges) forms a cycle. + + DAGs are very important to Nix. + In particular, the non-self-[references][reference] of [store object][store object] form a cycle. + - [derivation path]{#gloss-derivation-path} A [store path] which uniquely identifies a [store derivation]. @@ -71,9 +78,8 @@ This can be achieved by: - Fetching a pre-built [store object] from a [substituter] - - Running the [`builder`](@docroot@/language/derivations.md#attr-builder) executable as specified in the corresponding [store derivation] + - [Building](@docroot@/store/building.md) the corresponding [store derivation] - Delegating to a [remote machine](@docroot@/command-ref/conf-file.md#conf-builders) and retrieving the outputs - See [`nix-store --realise`](@docroot@/command-ref/nix-store/realise.md) for a detailed description of the algorithm. @@ -156,6 +162,8 @@ non-[fixed-output](#gloss-fixed-output-derivation) derivation. + See [input-addressing derivation outputs](store/derivation/outputs/input-address.md) for details. + - [content-addressed store object]{#gloss-content-addressed-store-object} A [store object] which is [content-addressed](#gloss-content-address), @@ -215,23 +223,25 @@ > **Example** > - > Building and deploying software using Nix entails writing Nix expressions as a high-level description of packages and compositions thereof. + > Building and deploying software using Nix entails writing Nix expressions to describe [packages][package] and compositions thereof. - [reference]{#gloss-reference} - A [store object] `O` is said to have a *reference* to a store object `P` if a [store path] to `P` appears in the contents of `O`. + An edge from one [store object] to another. - Store objects can refer to both other store objects and themselves. - References from a store object to itself are called *self-references*. - References other than a self-reference must not form a cycle. + See [References](@docroot@/store/store-object.md#references) for details. [reference]: #gloss-reference + See [References](@docroot@/store/store-object.md#references) for details. + - [reachable]{#gloss-reachable} A store path `Q` is reachable from another store path `P` if `Q` is in the *closure* of the *references* relation. + See [References](@docroot@/store/store-object.md#references) for details. + - [closure]{#gloss-closure} The closure of a store path is the set of store paths that are @@ -248,8 +258,21 @@ to a store object at path `Q`, then `Q` is in the closure of `P`. Further, if `Q` references `R` then `R` is also in the closure of `P`. + See [References](@docroot@/store/store-object.md#references) for details. + [closure]: #gloss-closure +- [requisite]{#gloss-requisite} + + A store object [reachable] by a path (chain of references) from a given [store object]. + The [closure] is the set of requisites. + + See [References](@docroot@/store/store-object.md#references) for details. + +- [referrer]{#gloss-reference} + + A reversed edge from one [store object] to another. + - [output]{#gloss-output} A [store object] produced by a [store derivation]. @@ -320,7 +343,7 @@ See [Nix Archive](store/file-system-object/content-address.html#serial-nix-archive) for details. -- [`∅`]{#gloss-emtpy-set} +- [`∅`]{#gloss-empty-set} The empty set symbol. In the context of profile history, this denotes a package is not present in a particular version of the profile. @@ -330,18 +353,17 @@ - [package]{#package} - 1. A software package; a collection of files and other data. + A software package; files that belong together for a particular purpose, and metadata. - 2. A [package attribute set]. + Nix represents files as [file system objects][file system object], and how they belong together is encoded as [references][reference] between [store objects][store object] that contain these file system objects. -- [package attribute set]{#package-attribute-set} + The [Nix language] allows denoting packages in terms of [attribute sets](@docroot@/language/types.md#attribute-set) containing: + - attributes that refer to the files of a package, typically in the form of [derivation outputs](#output), + - attributes with metadata, such as information about how the package is supposed to be used. - An [attribute set](@docroot@/language/types.md#attribute-set) containing the attribute `type = "derivation";` (derivation for historical reasons), as well as other attributes, such as - - attributes that refer to the files of a [package], typically in the form of [derivation outputs](#output), - - attributes that declare something about how the package is supposed to be installed or used, - - other metadata or arbitrary attributes. + The exact shape of these attribute sets is up to convention. - [package attribute set]: #package-attribute-set + [package]: #package - [string interpolation]{#gloss-string-interpolation} diff --git a/doc/manual/source/introduction.md b/doc/manual/source/introduction.md index a95e82740..fedb5595a 100644 --- a/doc/manual/source/introduction.md +++ b/doc/manual/source/introduction.md @@ -15,8 +15,9 @@ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix ## How Nix works -Nix treats packages like values in purely functional programming languages -such as Haskell — they are built by functions that don’t have +Nix is a _purely functional package manager_. This means that it +treats packages like values in a purely functional programming language +— packages are built by functions that don’t have side-effects, and they never change after they have been built. Nix stores packages in the _Nix store_, usually the directory `/nix/store`, where each package has its own unique subdirectory such diff --git a/doc/manual/source/language/advanced-attributes.md b/doc/manual/source/language/advanced-attributes.md index bf196e0b8..a939847e1 100644 --- a/doc/manual/source/language/advanced-attributes.md +++ b/doc/manual/source/language/advanced-attributes.md @@ -73,12 +73,14 @@ Derivations can declare some infrequently used optional attributes. > **Warning** > - > If set to `true`, other advanced attributes such as [`allowedReferences`](#adv-attr-allowedReferences), [`allowedReferences`](#adv-attr-allowedReferences), [`allowedRequisites`](#adv-attr-allowedRequisites), + > If set to `true`, other advanced attributes such as [`allowedReferences`](#adv-attr-allowedReferences), [`allowedRequisites`](#adv-attr-allowedRequisites), [`disallowedReferences`](#adv-attr-disallowedReferences) and [`disallowedRequisites`](#adv-attr-disallowedRequisites), maxSize, and maxClosureSize. will have no effect. ## Output checks +See the [corresponding section in the derivation output page](@docroot@/store/derivation/outputs/index.md). + - [`allowedReferences`]{#adv-attr-allowedReferences}\ The optional attribute `allowedReferences` specifies a list of legal references (dependencies) of the output of the builder. For example, @@ -280,7 +282,7 @@ All other combinations are invalid. Call by need is commonly known as laziness in functional programming, as it is a specific implementation of the concept where evaluation is deferred until the result is required, aiming to only evaluate the parts of an expression that are needed to produce the final result. + +Furthermore, the result of evaluation is preserved, in values, in `let` bindings, in function _parameters_, which behave a lot like `let` bindings, but with the notable exception of function _calls_. Results of function calls rely on being put into `let` bindings, etc to be reused. + +When discussing the process of evaluation in lower level terms, we may define values not as a subset of expressions, but separately, where each "value" is either a data constructor, a function or a _thunk_. A thunk is a delayed computation, represented by an expression reference and a "closure" – the values for the lexical scope around the delayed expression. + +As a user of the language, you generally don't have to think about thunks, as they are not part of the language semantics, but you may encounter them in the repl, in the [C API] or in discussions. + +## Strictness + +Instead of thinking about thunks, it is often more productive to think in terms of _strictness_. +This term is used in functional programming to refer to the opposite of laziness, i.e. not just for something like error propagation. It refers to the need to evaluate certain expressions before evaluation can produce any result. + +Statements about strictness usually implicitly refer to weak head normal form. +For example, we can say that the following function is strict in its argument: + +```nix +x: isAttrs x || isFunction x +``` + +The above function must be strict in its argument `x` because determining its type requires evaluating `x` to at least some degree. + +The following function is not strict in its argument: + +```nix +x: { isOk = isAttrs x || isFunction x; } +``` + +It is not strict, because it can return the attribute set before evaluating `x`. +The attribute value for `isOk` _is_ strict in `x`. + +A function with a _set pattern_ is always strict in its argument, as a consequence of checking the argument's type and/or attribute names: + +```nix +let f = { ... }: "ok"; +in f (throw "kablam") +=> error: kablam +``` + +However, a set pattern does not add any strictness beyond WHNF of the attribute set argument. + +```nix +let f = orig@{ x, ... }: "ok"; +in f { x = throw "error"; y = throw "error"; } +=> "ok" +``` + +[C API]: @docroot@/c-api.md diff --git a/doc/manual/source/language/index.md b/doc/manual/source/language/index.md index 2bfdbb8a0..5bb939e18 100644 --- a/doc/manual/source/language/index.md +++ b/doc/manual/source/language/index.md @@ -11,7 +11,14 @@ The language is: - *domain-specific* - It comes with [built-in functions](@docroot@/language/builtins.md) to integrate with the Nix store, which manages files and performs the derivations declared in the Nix language. + The Nix language is purpose-built for working with text files. + Its most characteristic features are: + + - [File system path primitives](@docroot@/language/types.md#type-path), for accessing source files + - [Indented strings](@docroot@/language/string-literals.md) and [string interpolation](@docroot@/language/string-interpolation.md), for creating file contents + - [Strings with contexts](@docroot@/language/string-context.md), for transparently linking files + + It comes with [built-in functions](@docroot@/language/builtins.md) to integrate with the [Nix store](@docroot@/store/index.md), which manages files and enables [realising](@docroot@/glossary.md#gloss-realise) derivations declared in the Nix language. - *declarative* diff --git a/doc/manual/source/language/string-context.md b/doc/manual/source/language/string-context.md index 979bbf371..0d8fcdefa 100644 --- a/doc/manual/source/language/string-context.md +++ b/doc/manual/source/language/string-context.md @@ -13,8 +13,8 @@ The purpose of string contexts is to collect non-string values attached to strin [string concatenation](./operators.md#string-concatenation), [string interpolation](./string-interpolation.md), and similar operations. -The idea is that a user can combine together values to create a build instructions for derivations without manually keeping track of where they come from. -Then the Nix language implicitly does that bookkeeping to efficiently obtain the closure of derivation inputs. +The idea is that a user can reference other files when creating text files through Nix expressions, without manually keeping track of the exact paths. +Nix will ensure that the all referenced files are accessible – that all [store paths](@docroot@/glossary.md#gloss-store-path) are [valid](@docroot@/glossary.md#gloss-validity). > **Note** > diff --git a/doc/manual/source/protocols/json/derivation.md b/doc/manual/source/protocols/json/derivation.md index 414a862e8..92956091a 100644 --- a/doc/manual/source/protocols/json/derivation.md +++ b/doc/manual/source/protocols/json/derivation.md @@ -18,7 +18,7 @@ is a JSON object with the following fields: * `method`: - For an output which will be [content addresed], a string representing the [method](@docroot@/store/store-object/content-address.md) of content addressing that is chosen. + For an output which will be [content addressed], a string representing the [method](@docroot@/store/store-object/content-address.md) of content addressing that is chosen. Valid method strings are: - [`flat`](@docroot@/store/store-object/content-address.md#method-flat) @@ -29,7 +29,7 @@ is a JSON object with the following fields: Otherwise, `null`. * `hashAlgo`: - For an output which will be [content addresed], the name of the hash algorithm used. + For an output which will be [content addressed], the name of the hash algorithm used. Valid algorithm strings are: - `blake3` diff --git a/doc/manual/source/protocols/tarball-fetcher.md b/doc/manual/source/protocols/tarball-fetcher.md index 5cff05d66..e8cda784c 100644 --- a/doc/manual/source/protocols/tarball-fetcher.md +++ b/doc/manual/source/protocols/tarball-fetcher.md @@ -46,7 +46,7 @@ defined as the timestamp of the newest file inside the tarball. This protocol is supported by Gitea since v1.22.1 and by Forgejo since v7.0.4/v8.0.0 and can be used with the following flake URL schema: ``` -https://///archive/.tar.gz +https://///archive/.tar.gz ``` > **Example** diff --git a/doc/manual/source/release-notes-determinate/changes.md b/doc/manual/source/release-notes-determinate/changes.md index 757fcbbb0..5323b3150 100644 --- a/doc/manual/source/release-notes-determinate/changes.md +++ b/doc/manual/source/release-notes-determinate/changes.md @@ -1,6 +1,6 @@ # Changes between Nix and Determinate Nix -This section lists the differences between upstream Nix 2.28 and Determinate Nix 3.5.2. +This section lists the differences between upstream Nix 2.29 and Determinate Nix 3.6.1. * In Determinate Nix, flakes are stable. You no longer need to enable the `flakes` experimental feature. @@ -28,4 +28,10 @@ This section lists the differences between upstream Nix 2.28 and Determinate Nix -* Tell users a source is corrupted ("cannot read file from tarball: Truncated tar archive detected while reading data"), improving over the previous 'cannot read file from tarball' error by @edolstra in [DeterminateSystems/nix-src#64](https://github.com/DeterminateSystems/nix-src/pull/64) \ No newline at end of file +* Tell users a source is corrupted ("cannot read file from tarball: Truncated tar archive detected while reading data"), improving over the previous 'cannot read file from tarball' error by @edolstra in [DeterminateSystems/nix-src#64](https://github.com/DeterminateSystems/nix-src/pull/64) + + +* Emit warnings when using import-from-derivation by setting the `trace-import-from-derivation` option to `true` by @gustavderdrache in [DeterminateSystems/nix-src#70](https://github.com/DeterminateSystems/nix-src/pull/70) + + +* Fix nlohmann error in fromStructuredAttrs() by @edolstra in [DeterminateSystems/nix-src#73](https://github.com/DeterminateSystems/nix-src/pull/73) \ No newline at end of file diff --git a/doc/manual/source/release-notes-determinate/rl-3.6.0.md b/doc/manual/source/release-notes-determinate/rl-3.6.0.md new file mode 100644 index 000000000..453ab6c30 --- /dev/null +++ b/doc/manual/source/release-notes-determinate/rl-3.6.0.md @@ -0,0 +1,11 @@ +# Release 3.6.0 (2025-05-22) + +* Based on [upstream Nix 2.29.0](../release-notes/rl-2.29.md). + +## What's Changed +* Install 'nix profile add' manpage by @edolstra in [DeterminateSystems/nix-src#69](https://github.com/DeterminateSystems/nix-src/pull/69) +* Sync with upstream 2.29.0 by @edolstra in [DeterminateSystems/nix-src#67](https://github.com/DeterminateSystems/nix-src/pull/67) +* Emit warnings when using import-from-derivation by setting the `trace-import-from-derivation` option to `true` by @gustavderdrache in [DeterminateSystems/nix-src#70](https://github.com/DeterminateSystems/nix-src/pull/70) + + +**Full Changelog**: [v3.5.2...v3.6.0](https://github.com/DeterminateSystems/nix-src/compare/v3.5.2...v3.6.0) diff --git a/doc/manual/source/release-notes-determinate/rl-3.6.1.md b/doc/manual/source/release-notes-determinate/rl-3.6.1.md new file mode 100644 index 000000000..12505afee --- /dev/null +++ b/doc/manual/source/release-notes-determinate/rl-3.6.1.md @@ -0,0 +1,9 @@ +# Release 3.6.1 (2025-05-24) + +* Based on [upstream Nix 2.29.0](../release-notes/rl-2.29.md). + +## What's Changed +* Fix nlohmann error in fromStructuredAttrs() by @edolstra in [DeterminateSystems/nix-src#73](https://github.com/DeterminateSystems/nix-src/pull/73) + + +**Full Changelog**: [v3.6.0...v3.6.1](https://github.com/DeterminateSystems/nix-src/compare/v3.6.0...v3.6.1) diff --git a/doc/manual/source/release-notes/rl-2.19.md b/doc/manual/source/release-notes/rl-2.19.md index 13e573c1d..47a0dd3db 100644 --- a/doc/manual/source/release-notes/rl-2.19.md +++ b/doc/manual/source/release-notes/rl-2.19.md @@ -31,7 +31,7 @@ - To operate on a flake outside the current directory, you must now pass `--flake path/to/flake`. - The flake-specific flags `--recreate-lock-file` and `--update-input` have been removed from all commands operating on installables. - They are superceded by `nix flake update`. + They are superseded by `nix flake update`. - Commit signature verification for the [`builtins.fetchGit`](@docroot@/language/builtins.md#builtins-fetchGit) is added as the new [`verified-fetches` experimental feature](@docroot@/development/experimental-features.md#xp-feature-verified-fetches). diff --git a/doc/manual/source/release-notes/rl-2.23.md b/doc/manual/source/release-notes/rl-2.23.md index 249c183e6..e6b0e9ffc 100644 --- a/doc/manual/source/release-notes/rl-2.23.md +++ b/doc/manual/source/release-notes/rl-2.23.md @@ -15,7 +15,7 @@ - Modify `nix derivation {add,show}` JSON format [#9866](https://github.com/NixOS/nix/issues/9866) [#10722](https://github.com/NixOS/nix/pull/10722) The JSON format for derivations has been slightly revised to better conform to our [JSON guidelines](@docroot@/development/cli-guideline.md#returning-future-proof-json). - In particular, the hash algorithm and content addressing method of content-addresed derivation outputs are now separated into two fields `hashAlgo` and `method`, + In particular, the hash algorithm and content addressing method of content-addressed derivation outputs are now separated into two fields `hashAlgo` and `method`, rather than one field with an arcane `:`-separated format. This JSON format is only used by the experimental `nix derivation` family of commands, at this time. diff --git a/doc/manual/source/release-notes/rl-2.24.md b/doc/manual/source/release-notes/rl-2.24.md index 31e843eb6..0d6823a68 100644 --- a/doc/manual/source/release-notes/rl-2.24.md +++ b/doc/manual/source/release-notes/rl-2.24.md @@ -173,7 +173,7 @@ **Deprecation**: Use `nix32` instead of `base32` as `toHashFormat` For the builtin `convertHash`, the `toHashFormat` parameter now accepts the same hash formats as the `--to`/`--from` - parameters of the `nix hash conert` command: `"base16"`, `"nix32"`, `"base64"`, and `"sri"`. The former `"base32"` value + parameters of the `nix hash convert` command: `"base16"`, `"nix32"`, `"base64"`, and `"sri"`. The former `"base32"` value remains as a deprecated alias for `"nix32"`. Please convert your code from: ```nix diff --git a/doc/manual/source/release-notes/rl-2.29.md b/doc/manual/source/release-notes/rl-2.29.md new file mode 100644 index 000000000..ad63fff2f --- /dev/null +++ b/doc/manual/source/release-notes/rl-2.29.md @@ -0,0 +1,160 @@ +# Release 2.29.0 (2025-05-14) + +After the special backport-based release of Nix 2.28 (timed to coincide with Nixpkgs 25.05), the release process is back to normal with 2.29. +As such, we have slightly more weeks of work from `master` (since 2.28 was branched from 2.27) than usual. +This fact is counterbalanced by the fact that most of those changes are bug fixes rather than larger new features. + +- Prettified JSON output on the terminal [#12555](https://github.com/NixOS/nix/issues/12555) [#12652](https://github.com/NixOS/nix/pull/12652) + + This makes the output easier to read. + + Scripts are mostly unaffected because for those, stdout will be a file or a pipe, not a terminal, and for those, the old single-line behavior applies. + + `--json --pretty` can be passed to enable it even if the output is not a terminal. + If your script creates a pseudoterminal for Nix's stdout, you can pass `--no-pretty` to disable the new behavior. + +- Repl: improve continuation prompt for incomplete expressions [#12846](https://github.com/NixOS/nix/pull/12846) + + Improved REPL user experience by updating the continuation prompt from invisible blank spaces to a visible `" > "`, enhancing clarity when entering multi-line expressions. + +- REPL `:load-flake` and `:reload` now work together [#8753](https://github.com/NixOS/nix/issues/8753) [#13180](https://github.com/NixOS/nix/pull/13180) + + Previously, `:reload` only reloaded the files specified with `:load` (or on the command line). + Now, it also works with the flakes specified with `:load-flake` (or on the command line). + This makes it correctly reload everything that was previously loaded, regardless of what sort of thing (plain file or flake) each item is. + +- Increase retry delays on HTTP 429 Too Many Requests [#13052](https://github.com/NixOS/nix/pull/13052) + + When downloading Nix, the retry delay was previously set to 0.25 seconds. It has now been increased to 1 minute to better handle transient CI errors, particularly on GitHub. + +- S3: opt-in the STSProfileCredentialsProvider [#12646](https://github.com/NixOS/nix/pull/12646) + + Added support for STS-based authentication for S3-based binary caches, i.e. enabling seamless integration with `aws sso login`. + +- Reduce connect timeout for http substituter [#12876](https://github.com/NixOS/nix/pull/12876) + + Previously, the Nix setting `connect-timeout` had no limit. It is now set to `5s`, offering a more practical default for users self-hosting binary caches, which may occasionally become unavailable, such as during updates. + + +- C API: functions for locking and loading a flake [#10435](https://github.com/NixOS/nix/issues/10435) [#12877](https://github.com/NixOS/nix/pull/12877) [#13098](https://github.com/NixOS/nix/pull/13098) + + This release adds functions to the C API for handling the loading of flakes. Previously, this had to be worked around by using `builtins.getFlake`. + C API consumers and language bindings now have access to basic locking functionality. + + It does not expose the full locking API, so that the implementation can evolve more freely. + Locking is controlled with the functions, which cover the common use cases for consuming a flake: + - `nix_flake_lock_flags_set_mode_check` + - `nix_flake_lock_flags_set_mode_virtual` + - `nix_flake_lock_flags_set_mode_write_as_needed` + - `nix_flake_lock_flags_add_input_override`, which also enables `virtual` + + This change also introduces the new `nix-fetchers-c` library, whose single purpose for now is to manage the (`nix.conf`) settings for the built-in fetchers. + + More details can be found in the [C API documentation](@docroot@/c-api.md). + +- No longer copy flakes that are in the nix store [#10435](https://github.com/NixOS/nix/issues/10435) [#12877](https://github.com/NixOS/nix/pull/12877) [#13098](https://github.com/NixOS/nix/pull/13098) + + Previously, we would duplicate entries like `path:/nix/store/*` back into the Nix store. + This was prominently visible for pinned system flake registry entries in NixOS, e.g., when running `nix run nixpkgs#hello`. + +- Consistently preserve error messages from cached evaluation [#12762](https://github.com/NixOS/nix/issues/12762) [#12809](https://github.com/NixOS/nix/pull/12809) + + In one code path, we are not returning the errors cached from prior evaluation, but instead throwing generic errors stemming from the lack of value (due to the error). + These generic error messages were far less informative. + Now we consistently return the original error message. + +- Faster blake3 hashing [#12676](https://github.com/NixOS/nix/pull/12676) + + The implementation for blake3 hashing is now multi-threaded and used memory-mapped IO. + Benchmark results can be found the [pull request](https://github.com/NixOS/nix/pull/12676). + +- Fix progress bar for S3 binary caches and make file transfers interruptible [#12877](https://github.com/NixOS/nix/issues/12877) [#13098](https://github.com/NixOS/nix/issues/13098) [#12538](https://github.com/NixOS/nix/pull/12538) + + The progress bar now correctly display upload/download progress for S3 up/downloads. S3 uploads are now interruptible. + +- Add host attribute of github/gitlab flakerefs to URL serialization [#12580](https://github.com/NixOS/nix/pull/12580) + + Resolved an issue where `github:` or `gitlab:` URLs lost their `host` attribute when written to a lockfile, resulting in invalid URLs. + +- Multiple signatures support in store urls [#12976](https://github.com/NixOS/nix/pull/12976) + + Added support for a `secretKeyFiles` URI parameter in Nix store URIs, allowing multiple signing key files to be specified as a comma-separated list. + This enables signing paths with multiple keys. This helps with [RFC #149](https://github.com/NixOS/rfcs/pull/149) to enable binary cache key rotation in the NixOS infra. + + Example usage: + + ```bash + nix copy --to "file:///tmp/store?secret-keys=/tmp/key1,/tmp/key2" \ + "$(nix build --print-out-paths nixpkgs#hello)" + ``` + +- nix flake show now skips over import-from-derivation [#4265](https://github.com/NixOS/nix/issues/4265) [#12583](https://github.com/NixOS/nix/pull/12583) + + Previously, if a flake contained outputs relying on [import from derivation](@docroot@/language/import-from-derivation.md) during evaluation, `nix flake show` would fail to display the rest of the flake. The updated behavior skips such outputs, allowing the rest of the flake to be shown. + +- Add `nix formatter build` and `nix formatter run` commands [#13063](https://github.com/NixOS/nix/pull/13063) + + `nix formatter run` is an alias for `nix fmt`. Nothing new there. + + `nix formatter build` is sort of like `nix build`: it builds, links, and prints a path to the formatter program: + + ``` + $ nix formatter build + /nix/store/cb9w44vkhk2x4adfxwgdkkf5gjmm856j-treefmt/bin/treefmt + ``` + + Note that unlike `nix build`, this prints the full path to the program, not just the store path (in the example above that would be `/nix/store/cb9w44vkhk2x4adfxwgdkkf5gjmm856j-treefmt`). + +- Amend OSC 8 escape stripping for xterm-style separator [#13109](https://github.com/NixOS/nix/pull/13109) + + Improve terminal escape code filtering to understand a second type of hyperlink escape codes. + This in particular prevents parts of GCC 14's diagnostics from being improperly filtered away. + + +# Contributors + + +This release was made possible by the following 40 contributors: + +- Farid Zakaria [**(@fzakaria)**](https://github.com/fzakaria) +- The Tumultuous Unicorn Of Darkness [**(@TheTumultuousUnicornOfDarkness)**](https://github.com/TheTumultuousUnicornOfDarkness) +- Robert Hensing [**(@roberth)**](https://github.com/roberth) +- Félix [**(@picnoir)**](https://github.com/picnoir) +- Valentin Gagarin [**(@fricklerhandwerk)**](https://github.com/fricklerhandwerk) +- Eelco Dolstra [**(@edolstra)**](https://github.com/edolstra) +- Vincent Breitmoser [**(@Valodim)**](https://github.com/Valodim) +- Brian McKenna [**(@puffnfresh)**](https://github.com/puffnfresh) +- ulucs [**(@ulucs)**](https://github.com/ulucs) +- John Ericson [**(@Ericson2314)**](https://github.com/Ericson2314) +- Andrey Butirsky [**(@bam80)**](https://github.com/bam80) +- Dean De Leo [**(@whatsthecraic)**](https://github.com/whatsthecraic) +- Las Safin [**(@L-as)**](https://github.com/L-as) +- Sergei Zimmerman [**(@xokdvium)**](https://github.com/xokdvium) +- Shahar "Dawn" Or [**(@mightyiam)**](https://github.com/mightyiam) +- Ryan Hendrickson [**(@rhendric)**](https://github.com/rhendric) +- Rodney Lorrimar [**(@rvl)**](https://github.com/rvl) +- Erik Nygren [**(@Kirens)**](https://github.com/Kirens) +- Cole Helbling [**(@cole-h)**](https://github.com/cole-h) +- Martin Fischer [**(@not-my-profile)**](https://github.com/not-my-profile) +- Graham Christensen [**(@grahamc)**](https://github.com/grahamc) +- Vit Gottwald [**(@VitGottwald)**](https://github.com/VitGottwald) +- silvanshade [**(@silvanshade)**](https://github.com/silvanshade) +- Illia Bobyr [**(@ilya-bobyr)**](https://github.com/ilya-bobyr) +- Jeremy Fleischman [**(@jfly)**](https://github.com/jfly) +- Ruby Rose [**(@oldshensheep)**](https://github.com/oldshensheep) +- Sergei Trofimovich [**(@trofi)**](https://github.com/trofi) +- Tim [**(@Jaculabilis)**](https://github.com/Jaculabilis) +- Anthony Wang [**(@anthowan)**](https://github.com/anthowan) +- Jörg Thalheim [**(@Mic92)**](https://github.com/Mic92) +- Sandro [**(@SuperSandro2000)**](https://github.com/SuperSandro2000) +- tomberek [**(@tomberek)**](https://github.com/tomberek) +- Dmitry Bogatov [**(@KAction)**](https://github.com/KAction) +- Sizhe Zhao [**(@Prince213)**](https://github.com/Prince213) +- jade [**(@lf-)**](https://github.com/lf-) +- Pierre-Etienne Meunier [**(@P-E-Meunier)**](https://github.com/P-E-Meunier) +- Alexander Romanov [**(@ajlekcahdp4)**](https://github.com/ajlekcahdp4) +- Domagoj Mišković [**(@allrealmsoflife)**](https://github.com/allrealmsoflife) +- Thomas Miedema [**(@thomie)**](https://github.com/thomie) +- Yannik Sander [**(@ysndr)**](https://github.com/ysndr) +- Philipp Otterbein +- Dmitry Bogatov diff --git a/doc/manual/source/release-notes/rl-2.6.md b/doc/manual/source/release-notes/rl-2.6.md index 280faead1..f99ce4b4e 100644 --- a/doc/manual/source/release-notes/rl-2.6.md +++ b/doc/manual/source/release-notes/rl-2.6.md @@ -13,7 +13,7 @@ * New command `nix store copy-log` to copy build logs from one store to another. * The `commit-lockfile-summary` option can be set to a non-empty - string to override the commit summary used when commiting an updated + string to override the commit summary used when committing an updated lockfile. This may be used in conjunction with the `nixConfig` attribute in `flake.nix` to better conform to repository conventions. diff --git a/doc/manual/source/store/derivation/outputs/content-address.md b/doc/manual/source/store/derivation/outputs/content-address.md index 4539a5eba..4d5130348 100644 --- a/doc/manual/source/store/derivation/outputs/content-address.md +++ b/doc/manual/source/store/derivation/outputs/content-address.md @@ -23,7 +23,7 @@ The output spec for an output with a fixed content addresses additionally contai > **Design note** > > In principle, the output spec could also specify the references the store object should have, since the references and file system objects are equally parts of a content-addressed store object proper that contribute to its content-addressed. -> However, at this time, the references are not not done because all fixed content-addressed outputs are required to have no references (including no self-reference). +> However, at this time, the references are not done because all fixed content-addressed outputs are required to have no references (including no self-reference). > > Also in principle, rather than specifying the references and file system object data with separate hashes, a single hash that constraints both could be used. > This could be done with the final store path's digest, or better yet, the hash that will become the store path's digest before it is truncated. @@ -110,18 +110,18 @@ Because the derivation output is not fixed (just like with [input addressing]), > > Strictly speaking, the extent to which sandboxing and deprivilaging is possible varies with the environment Nix is running in. > Nix's configuration settings indicate what level of sandboxing is required or enabled. -> Builds of derivations will fail if they request an absense of sandboxing which is not allowed. -> Builds of derivations will also fail if the level of sandboxing specified in the configure exceeds what is possible in teh given environment. +> Builds of derivations will fail if they request an absence of sandboxing which is not allowed. +> Builds of derivations will also fail if the level of sandboxing specified in the configure exceeds what is possible in the given environment. > -> (The "environment", in this case, consists of attributes such as the Operating System Nix runs atop, along with the operating-system-specific privilages that Nix has been granted. -> Because of how conventional operating systems like macos, Linux, etc. work, granting builders *fewer* privilages may ironically require that Nix be run with *more* privilages.) +> (The "environment", in this case, consists of attributes such as the Operating System Nix runs atop, along with the operating-system-specific privileges that Nix has been granted. +> Because of how conventional operating systems like macos, Linux, etc. work, granting builders *fewer* privileges may ironically require that Nix be run with *more* privileges.) -That said, derivations producing floating content-addressed outputs may declare their builders as impure (like the builders of derivations producing producing fixed outputs). +That said, derivations producing floating content-addressed outputs may declare their builders as impure (like the builders of derivations producing fixed outputs). This is provisionally supported as part of the [`impure-derivations`][xp-feature-impure-derivations] experimental feature. ### Compatibility negotiation -Any derivation producing a floating content-addresssed output implicitly requires the `ca-derivations` [system feature](@docroot@/command-ref/conf-file.md#conf-system-features). +Any derivation producing a floating content-addressed output implicitly requires the `ca-derivations` [system feature](@docroot@/command-ref/conf-file.md#conf-system-features). This prevents scheduling the building of the derivation on a machine without the experimental feature enabled. Even once the experimental feature is stabilized, this is still useful in order to be allow using remote builder running odler versions of Nix, or alternative implementations that do not support floating content addressing. @@ -132,7 +132,7 @@ For store objects produced by manually inserting into the store to create a stor But for store objects produced by derivation, the "method is quite formal" --- the whole point of derivations is to be a formal notion of building, after all. In this case, we can elevate this informal property to a formal one. -A *determinstic* content-addressing derivation should produce outputs with the same content addresses: +A *deterministic* content-addressing derivation should produce outputs with the same content addresses: 1. Every time the builder is run @@ -144,7 +144,7 @@ A *determinstic* content-addressing derivation should produce outputs with the s The choice of provisional store path can be thought of as an impurity, since it is an arbitrary choice. If provisional outputs paths are deterministically chosen, we are in the first branch of part (1). - The builder the data it produces based on it in arbitrary ways, but this gets us closer to to [input addressing]. + The builder the data it produces based on it in arbitrary ways, but this gets us closer to [input addressing]. Deterministically choosing the provisional path may be considered "complete sandboxing" by removing an impurity, but this is unsatisfactory