mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-10 08:39:08 +03:00
22 lines
591 B
Nix
22 lines
591 B
Nix
{ lib, version }:
|
|
|
|
with lib;
|
|
{
|
|
# 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);
|
|
|
|
|
|
# Keeping these around in case we decide to change this horrible implementation :)
|
|
option = x:
|
|
x // { optional = true; };
|
|
|
|
yes = { tristate = "y"; };
|
|
no = { tristate = "n"; };
|
|
module = { tristate = "m"; };
|
|
freeform = x: { freeform = x; };
|
|
|
|
}
|