mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
cefd0302b5
desugaring inherit-from to syntactic duplication of the source expr also duplicates side effects of the source expr (such as trace calls) and expensive computations (such as derivationStrict).
16 lines
277 B
Nix
16 lines
277 B
Nix
let
|
|
inherit (builtins.trace "used" { a = 1; b = 2; }) a b;
|
|
x.c = 3;
|
|
y.d = 4;
|
|
|
|
merged = {
|
|
inner = {
|
|
inherit (y) d;
|
|
};
|
|
|
|
inner = {
|
|
inherit (x) c;
|
|
};
|
|
};
|
|
in
|
|
[ a b rec { x.c = []; inherit (x) c; inherit (y) d; __overrides.y.d = []; } merged ]
|