nixir/tests/fixtures/inherit.nix
NotAShelf ae505188fc
tests: move fixtures to dedicated dir
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9d6ce6a264780f215b1b57d947b5264c6a6a6964
2026-02-23 02:26:46 +03:00

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;
}