Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I70cd1dfa45add9df58a44add69fbd30a6a6a6964
17 lines
252 B
Nix
17 lines
252 B
Nix
# Test inherit keyword
|
|
let
|
|
x = 10;
|
|
y = 20;
|
|
attrs = { a = 1; b = 2; c = 3; };
|
|
in
|
|
{
|
|
# Basic inherit from outer scope
|
|
inherit x y;
|
|
|
|
# Inherit from expression
|
|
inherit (attrs) a b;
|
|
|
|
# Mixed
|
|
z = 30;
|
|
inherit (attrs) c;
|
|
}
|