2018-10-03 03:53:23 -06:00
|
|
|
{ lib, version }:
|
2016-01-05 07:22:43 -07:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
rec {
|
2018-10-03 03:53:23 -06:00
|
|
|
# Common patterns/legacy
|
|
|
|
whenAtLeast = ver: mkIf (versionAtLeast version ver);
|
|
|
|
whenOlder = ver: mkIf (versionOlder version ver);
|
|
|
|
# range is (inclusive, exclusive)
|
|
|
|
whenBetween = verLow: verHigh: mkIf (versionAtLeast version verLow && versionOlder version verHigh);
|
2016-01-05 07:22:43 -07:00
|
|
|
|
|
|
|
|
2018-10-03 03:49:50 -06:00
|
|
|
# Keeping these around in case we decide to change this horrible implementation :)
|
|
|
|
option = x:
|
|
|
|
x // { optional = true; };
|
2016-01-05 07:22:43 -07:00
|
|
|
|
2018-10-03 03:49:50 -06:00
|
|
|
yes = { tristate = "y"; };
|
|
|
|
no = { tristate = "n"; };
|
|
|
|
module = { tristate = "m"; };
|
|
|
|
freeform = x: { freeform = x; };
|
2016-01-05 07:22:43 -07:00
|
|
|
|
|
|
|
}
|