summaryrefslogtreecommitdiff
path: root/Nix Inherit.md
blob: 4a8adb01b8b25bb596b0dfa8fe7bef50b31b221a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
```