summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohannes Kirschbauer <hsjobeki@gmail.com>2025-04-23 14:09:23 +0200
committerGitHub <noreply@github.com>2025-04-23 14:09:23 +0200
commitbda0c8532b1c2bef839d18d483c4b4e2e8de38c9 (patch)
tree337cb7029055c5fbc1690926a7c6df2d870d7da2 /lib
parentnodejs_18: drop due to upstream EOL (#399426) (diff)
parentlib.getAttrFromPath: fix docs (diff)
downloadnixpkgs-bda0c8532b1c2bef839d18d483c4b4e2e8de38c9.tar.gz
lib.getAttrFromPath: fix docs (#400948)
Diffstat (limited to 'lib')
-rw-r--r--lib/attrsets.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix
index 8482887023f7..4518a94b6745 100644
--- a/lib/attrsets.nix
+++ b/lib/attrsets.nix
@@ -301,9 +301,9 @@ rec {
Nix has an [attribute selection operator](https://nixos.org/manual/nix/stable/language/operators#attribute-selection) which is sufficient for such queries, as long as the number of attributes is static. For example:
```nix
- x.a.b == getAttrByPath ["a" "b"] x
+ x.a.b == getAttrFromPath ["a" "b"] x
# and
- x.${f p}."example.com" == getAttrByPath [ (f p) "example.com" ] x
+ x.${f p}."example.com" == getAttrFromPath [ (f p) "example.com" ] x
```
# Inputs