Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ia9c1e9b0a8cd9c6d834f153609baa5426a6a6964
20 lines
248 B
Nix
20 lines
248 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;
|
|
}
|