7 # Keeping these around in case we decide to change this horrible implementation :)
9 x // { optional = true; };
11 yes = { tristate = "y"; optional = false; };
12 no = { tristate = "n"; optional = false; };
13 module = { tristate = "m"; optional = false; };
14 unset = { tristate = null; optional = false; };
15 freeform = x: { freeform = x; optional = false; };
18 Common patterns/legacy used in common-config/hardened/config.nix
20 whenHelpers = version: {
21 whenAtLeast = ver: mkIf (versionAtLeast version ver);
22 whenOlder = ver: mkIf (versionOlder version ver);
23 # range is (inclusive, exclusive)
24 whenBetween = verLow: verHigh: mkIf (versionAtLeast version verLow && versionOlder version verHigh);