nixir/tests/inherit.nix
NotAShelf b49044c9a5
nix: format test fixtures via nix fmt
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia9c1e9b0a8cd9c6d834f153609baa5426a6a6964
2026-02-22 21:51:22 +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;
}