2019-09-18 02:34:02 -06:00
|
|
|
{ lib }:
|
2016-01-05 07:22:43 -07:00
|
|
|
|
|
|
|
with lib;
|
2019-08-13 15:52:01 -06:00
|
|
|
{
|
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
|
|
|
|
2020-03-31 19:20:33 -06:00
|
|
|
yes = { tristate = "y"; optional = false; };
|
|
|
|
no = { tristate = "n"; optional = false; };
|
|
|
|
module = { tristate = "m"; optional = false; };
|
|
|
|
freeform = x: { freeform = x; optional = false; };
|
2016-01-05 07:22:43 -07:00
|
|
|
|
2019-09-19 05:12:35 -06:00
|
|
|
/*
|
2020-04-26 11:19:02 -06:00
|
|
|
Common patterns/legacy used in common-config/hardened/config.nix
|
2019-09-19 05:12:35 -06:00
|
|
|
*/
|
|
|
|
whenHelpers = version: {
|
|
|
|
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
|
|
|
}
|