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 freeform = x: { freeform = x; optional = false; };
17 Common patterns/legacy used in common-config/hardened/config.nix
19 whenHelpers = version: {
20 whenAtLeast = ver: mkIf (versionAtLeast version ver);
21 whenOlder = ver: mkIf (versionOlder version ver);
22 # range is (inclusive, exclusive)
23 whenBetween = verLow: verHigh: mkIf (versionAtLeast version verLow && versionOlder version verHigh);