mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
18 lines
362 B
Nix
18 lines
362 B
Nix
|
let
|
||
|
aString = "a";
|
||
|
|
||
|
bString = "b";
|
||
|
in {
|
||
|
hasAttrs = { a.b = null; } ? "${aString}".b;
|
||
|
|
||
|
selectAttrs = { a.b = true; }.a."${bString}";
|
||
|
|
||
|
selectOrAttrs = { }."${aString}" or true;
|
||
|
|
||
|
binds = { "${aString}"."${bString}c" = true; }.a.bc;
|
||
|
|
||
|
recBinds = rec { "${bString}" = a; a = true; }.b;
|
||
|
|
||
|
multiAttrs = { "${aString}" = true; "${bString}" = false; }.a;
|
||
|
}
|