summaryrefslogtreecommitdiff
path: root/Nix Inherit.md
diff options
context:
space:
mode:
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