mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-24 04:18:03 +00:00
lib/types: rename custom.nix to types.nix, mov theme.nix into types.nix
This commit is contained in:
parent
b2f694c78e
commit
5db7e2aff9
3 changed files with 11 additions and 19 deletions
|
@ -6,12 +6,10 @@
|
|||
typesDag = import ./dag.nix {inherit lib;};
|
||||
typesPlugin = import ./plugins.nix {inherit inputs lib;};
|
||||
typesLanguage = import ./languages.nix {inherit lib;};
|
||||
typesCustom = import ./custom.nix {inherit lib;};
|
||||
typesTheme = import ./theme.nix {inherit lib;};
|
||||
typesTypes = import ./types.nix {inherit lib;};
|
||||
in {
|
||||
inherit (typesDag) dagOf;
|
||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||
inherit (typesCustom) anythingConcatLists char;
|
||||
inherit (typesTheme) hexColorType;
|
||||
inherit (typesTypes) anythingConcatLists char hexColor;
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
{lib}: let
|
||||
inherit (lib.strings) isString;
|
||||
inherit (lib.types) mkOptionType;
|
||||
inherit (builtins) match;
|
||||
# This was almost entirely taken from raf himself.
|
||||
in {
|
||||
hexColorType = mkOptionType {
|
||||
name = "hex-color";
|
||||
descriptionClass = "noun";
|
||||
description = "RGB color in hex format";
|
||||
# Check to determine wether the provided color is base16-valid
|
||||
check = x: isString x && (match "#[0-9a-fA-F]{6}" x) != null;
|
||||
};
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
{lib}: let
|
||||
inherit (lib) isStringLike showOption showFiles getFiles mergeOneOption mergeEqualOption mkOptionType;
|
||||
inherit (lib.strings) isString hasPrefix;
|
||||
inherit (lib.types) anything attrsOf;
|
||||
inherit (lib.nvim.types) anythingConcatLists;
|
||||
inherit (builtins) typeOf isAttrs any head concatLists stringLength;
|
||||
inherit (builtins) typeOf isAttrs any head concatLists stringLength match;
|
||||
in {
|
||||
# HACK: Does this break anything in our case?
|
||||
# A modified version of the nixpkgs anything type that concatenates lists
|
||||
|
@ -58,4 +59,11 @@ in {
|
|||
check = value: stringLength value < 2;
|
||||
merge = mergeEqualOption;
|
||||
};
|
||||
|
||||
hexColor = mkOptionType {
|
||||
name = "hex-color";
|
||||
descriptionClass = "noun";
|
||||
description = "RGB color in hex format";
|
||||
check = v: isString v && (match "#?[0-9a-fA-F]{6}" v) != null;
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue