git.iko.soy/typeable/nixpkgs
on 8a9d1aa help sign in
typeable/nixpkgs/lib/kernel.nix
26 lines 748 B history raw
1{ lib }:
3with lib;
4{
7 # Keeping these around in case we decide to change this horrible implementation :)
8 option = x:
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; };
16 /*
17 Common patterns/legacy used in common-config/hardened/config.nix
18 */
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);
24 };