mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 01:20:40 +00:00
cfb4d0dfe3
Fix kernel configuration merge
27 lines
748 B
Nix
27 lines
748 B
Nix
{ lib }:
|
|
|
|
with lib;
|
|
{
|
|
|
|
|
|
# Keeping these around in case we decide to change this horrible implementation :)
|
|
option = x:
|
|
x // { optional = true; };
|
|
|
|
yes = { tristate = "y"; optional = false; };
|
|
no = { tristate = "n"; optional = false; };
|
|
module = { tristate = "m"; optional = false; };
|
|
freeform = x: { freeform = x; optional = false; };
|
|
|
|
/*
|
|
Common patterns/legacy used in common-config/hardened/config.nix
|
|
*/
|
|
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);
|
|
};
|
|
|
|
}
|