You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
748 B

  1. { lib }:
  2. with lib;
  3. {
  4. # Keeping these around in case we decide to change this horrible implementation :)
  5. option = x:
  6. x // { optional = true; };
  7. yes = { tristate = "y"; optional = false; };
  8. no = { tristate = "n"; optional = false; };
  9. module = { tristate = "m"; optional = false; };
  10. freeform = x: { freeform = x; optional = false; };
  11. /*
  12. Common patterns/legacy used in common-config/hardened/config.nix
  13. */
  14. whenHelpers = version: {
  15. whenAtLeast = ver: mkIf (versionAtLeast version ver);
  16. whenOlder = ver: mkIf (versionOlder version ver);
  17. # range is (inclusive, exclusive)
  18. whenBetween = verLow: verHigh: mkIf (versionAtLeast version verLow && versionOlder version verHigh);
  19. };
  20. }