lib: cleanup; move mkBool to modules as mkBoolOption

This commit is contained in:
raf 2024-02-19 13:09:11 +03:00
commit 4eb26c0d98
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
4 changed files with 14 additions and 26 deletions

View file

@ -1,8 +0,0 @@
{lib}: {
mkBool = value: description:
lib.mkOption {
type = lib.types.bool;
default = value;
inherit description;
};
}

View file

@ -1,5 +1,5 @@
{lib}: {
bool = import ./bool.nix {inherit lib;};
modules = import ./modules.nix {inherit lib;};
dag = import ./dag.nix {inherit lib;};
types = import ./types {inherit lib;};
languages = import ./languages.nix {inherit lib;};

13
lib/modules.nix Normal file
View file

@ -0,0 +1,13 @@
{lib}: let
inherit (lib.options) mkOption;
inherit (lib.types) bool;
in {
# mkBoolOption: bool -> string -> option
# e.g. mkBoolOption true "Enable feature X"
mkBoolOption = value: description:
mkOption {
type = bool;
default = value;
inherit description;
};
}

View file

@ -1,17 +0,0 @@
# Copied from nmd master: https://gitlab.com/rycee/nmd/-/blob/master/default.nix?ref_type=heads
# Allows asciiDoc in options. It is easier to copy & keep updated then figure out how to pass the nmd input
# along to user modules
{
# Indicates that the given text should be interpreted as AsciiDoc markup.
asciiDoc = text: {
_type = "asciiDoc";
inherit text;
};
# Indicates that the given text should be interpreted as AsciiDoc markup and
# used in a literal context.
literalAsciiDoc = text: {
_type = "literalAsciiDoc";
inherit text;
};
}