From 4eb26c0d9885f73f72fcdba976e754ce26f57878 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 19 Feb 2024 13:09:11 +0300 Subject: [PATCH] lib: cleanup; move mkBool to modules as mkBoolOption --- lib/bool.nix | 8 -------- lib/default.nix | 2 +- lib/modules.nix | 13 +++++++++++++ lib/nmd.nix | 17 ----------------- 4 files changed, 14 insertions(+), 26 deletions(-) delete mode 100644 lib/bool.nix create mode 100644 lib/modules.nix delete mode 100644 lib/nmd.nix diff --git a/lib/bool.nix b/lib/bool.nix deleted file mode 100644 index 30a44842..00000000 --- a/lib/bool.nix +++ /dev/null @@ -1,8 +0,0 @@ -{lib}: { - mkBool = value: description: - lib.mkOption { - type = lib.types.bool; - default = value; - inherit description; - }; -} diff --git a/lib/default.nix b/lib/default.nix index ccc81059..fc5aca13 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -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;}; diff --git a/lib/modules.nix b/lib/modules.nix new file mode 100644 index 00000000..909a9f4b --- /dev/null +++ b/lib/modules.nix @@ -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; + }; +} diff --git a/lib/nmd.nix b/lib/nmd.nix deleted file mode 100644 index fd945f1c..00000000 --- a/lib/nmd.nix +++ /dev/null @@ -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; - }; -}