aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2023-07-08 12:28:13 +0200
committerNaïm Favier <n@monade.li>2023-07-21 17:14:03 +0200
commit570a1a3ad773d93aa2128a8fba49f98e1e115d5d (patch)
tree69860a99a55cc4dc0c8cb2acfd14c3e1fcfb9378 /doc
parent85d0eb63165e7d7f441fe3dd94bb548a40502e52 (diff)
parser: merge nested dynamic attributes
Fixes https://github.com/NixOS/nix/issues/7115
Diffstat (limited to 'doc')
-rw-r--r--doc/manual/src/release-notes/rl-next.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/manual/src/release-notes/rl-next.md b/doc/manual/src/release-notes/rl-next.md
index 139d07188..160245a31 100644
--- a/doc/manual/src/release-notes/rl-next.md
+++ b/doc/manual/src/release-notes/rl-next.md
@@ -6,3 +6,22 @@
- Nix now allows unprivileged/[`allowed-users`](../command-ref/conf-file.md#conf-allowed-users) to sign paths.
Previously, only [`trusted-users`](../command-ref/conf-file.md#conf-trusted-users) users could sign paths.
+
+- Nested dynamic attributes are now merged correctly by the parser. For example:
+
+ ```nix
+ {
+ nested = { foo = 1; };
+ nested = { ${"ba" + "r"} = 2; };
+ }
+ ```
+
+ This used to silently discard `nested.bar`, but now behaves as one would expect and evaluates to:
+
+ ```nix
+ { nested = { bar = 2; foo = 1; }; }
+ ```
+
+ Note that the feature of merging multiple attribute set declarations 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.