2022-06-23 02:57:41 -04:00
|
|
|
{ lib, pkgs }:
|
|
|
|
|
|
|
|
{
|
|
|
|
nLib = {
|
|
|
|
# mkEnableOption, but defaults to true
|
2022-10-13 22:13:43 -04:00
|
|
|
mkEnableOptionT = name:
|
|
|
|
lib.mkOption {
|
|
|
|
default = true;
|
|
|
|
example = false;
|
|
|
|
description = "Whether to enable ${name}.";
|
|
|
|
type = lib.types.bool;
|
|
|
|
};
|
2022-06-23 02:57:41 -04:00
|
|
|
# mkEnableOption, but with a default
|
2022-10-13 22:13:43 -04:00
|
|
|
mkDefaultOption = name: default:
|
|
|
|
lib.mkOption {
|
|
|
|
default = default;
|
|
|
|
example = false;
|
|
|
|
description = "Whether to enable ${name}.";
|
|
|
|
type = lib.types.bool;
|
|
|
|
};
|
2022-06-23 02:57:41 -04:00
|
|
|
# Returns an empty list if the current system is not linux
|
|
|
|
ifLinux = value: if pkgs.stdenv.isLinux then value else [ ];
|
|
|
|
# Appends if the predicate is true
|
|
|
|
appendIf = predicate: input: append:
|
|
|
|
if predicate then input ++ append else input;
|
|
|
|
};
|
|
|
|
}
|