summaryrefslogtreecommitdiff
path: root/Nix Inherit.md
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2025-03-29 11:32:44 +0100
committerJasper Ras <jras@hostnet.nl>2025-03-29 11:32:44 +0100
commit3f69286ef4b15161febb4a4bae085fb4c2c83bbf (patch)
tree10679f5b5e712242939a1eba233241fabfec1927 /Nix Inherit.md
parentfe63b70cae6e68adea7b25ad2f04ffc834b4e75f (diff)
vault backup: 2025-03-29 11:32:44
Diffstat (limited to 'Nix Inherit.md')
-rw-r--r--Nix Inherit.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/Nix Inherit.md b/Nix Inherit.md
new file mode 100644
index 0000000..4a8adb0
--- /dev/null
+++ b/Nix Inherit.md
@@ -0,0 +1,28 @@
+---
+tags:
+ - nix-lang
+---
+```nix
+let x = 123; in
+{
+ inherit x;
+ y = 456;
+}
+```
+==
+```nix
+let x = 123; in
+{
+ x = x;
+ y = 456;
+}
+```
+
+Can reference set
+```nix
+inherit (src-set) a b c;
+```
+==
+```nix
+a = src-set.a; b = src-set.b; c = src-set.c;
+``` \ No newline at end of file