summaryrefslogtreecommitdiff
path: root/Inheriting from sets.md
blob: 556f3d447341f8ecce719c37c0a94036d35f86f6 (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
29
---
tags:
  - nix
  - programming
---
```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;
```