diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-07-25 11:11:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-25 11:11:17 -0400 |
commit | 484c820c481ce1aabf0fe51e478eb0187bc68fb6 (patch) | |
tree | 18c9eefdb4ff027a7e6044bd62f7bd3fc18e389c | |
parent | ae3a7d6ebae80cfab41ef31c03a25926142e8a19 (diff) | |
parent | 1b756e300f98afe6a583f8bed3acd687d4a8abf9 (diff) |
Merge pull request #8741 from ncfavier/clarify-rl-notes-nested-attrs-merge
doc: clarify release notes about nested attribute merges
-rw-r--r-- | doc/manual/src/release-notes/rl-2.17.md | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/doc/manual/src/release-notes/rl-2.17.md b/doc/manual/src/release-notes/rl-2.17.md index 125a93cfd..0b861aecc 100644 --- a/doc/manual/src/release-notes/rl-2.17.md +++ b/doc/manual/src/release-notes/rl-2.17.md @@ -11,8 +11,12 @@ ```nix { - nested = { foo = 1; }; - nested = { ${"ba" + "r"} = 2; }; + nested = { + foo = 1; + }; + nested = { + ${"ba" + "r"} = 2; + }; } ``` @@ -22,8 +26,17 @@ { nested = { bar = 2; foo = 1; }; } ``` - Note that the feature of merging multiple attribute set declarations is of questionable value. + Note that the feature of merging multiple *full declarations* of attribute sets like `nested` in the example is of questionable value. It allows writing expressions that are very hard to read, for instance when there are many lines of code between two declarations of the same attribute. This has been around for a long time and is therefore supported for backwards compatibility, but should not be relied upon. + Instead, consider using the *nested attribute path* syntax: + + ```nix + { + nested.foo = 1; + nested.${"ba" + "r"} = 2; + } + ``` + * Tarball flakes can now redirect to an "immutable" URL that will be recorded in lock files. This allows the use of "mutable" tarball URLs like `https://example.org/hello/latest.tar.gz` in flakes. See the [tarball fetcher](../protocols/tarball-fetcher.md) for details. |