colorschemes/nord: switch to mkPlugin

This commit is contained in:
Gaetan Lepage 2024-01-08 15:24:05 +01:00 committed by Gaétan Lepage
parent 20c1ae069e
commit 3be30efc3b

View file

@ -1,58 +1,51 @@
{ {
lib, lib,
helpers,
config,
pkgs, pkgs,
... ...
}: } @ args:
with lib; let with lib;
cfg = config.colorschemes.nord; with import ../helpers.nix {inherit lib;};
in { mkPlugin args {
name = "nord";
description = "nord.nvim";
package = pkgs.vimPlugins.nord-nvim;
globalPrefix = "nord_";
options = { options = {
colorschemes.nord = { contrast = mkDefaultOpt {
enable = mkEnableOption "nord"; type = types.bool;
description = ''
package = helpers.mkPackageOption "nord.vim" pkgs.vimPlugins.nord-nvim; Make sidebars and popup menus like nvim-tree and telescope have a different background.
'';
contrast =
mkEnableOption
"Make sidebars and popup menus like nvim-tree and telescope have a different background";
borders =
mkEnableOption
"Enable the border between verticaly split windows visable";
disable_background =
mkEnableOption
"Disable the setting of background color so that NeoVim can use your terminal background";
cursorline_transparent =
mkEnableOption
"Set the cursorline transparent/visible";
enable_sidebar_background =
mkEnableOption
"Re-enables the background of the sidebar if you disabled the background of everything";
italic = mkOption {
description = "enables/disables italics";
type = types.nullOr types.bool;
default = null;
};
};
}; };
config = mkIf cfg.enable { borders = mkDefaultOpt {
colorscheme = "nord"; type = types.bool;
extraPlugins = [cfg.package]; description = "Enable the border between verticaly split windows visable.";
};
globals = { disable_background = mkDefaultOpt {
nord_contrast = mkIf cfg.contrast 1; type = types.bool;
nord_borders = mkIf cfg.borders 1; description = ''
nord_disable_background = mkIf cfg.disable_background 1; Disable the setting of background color so that NeoVim can use your terminal background.
nord_cursoline_transparent = mkIf cfg.cursorline_transparent 1; '';
nord_enable_sidebar_background = mkIf cfg.enable_sidebar_background 1; };
nord_italic = mkIf (cfg.italic != null) cfg.italic;
cursorline_transparent = mkDefaultOpt {
type = types.bool;
description = "Set the cursorline transparent/visible.";
};
enable_sidebar_background = mkDefaultOpt {
type = types.bool;
description = ''
Re-enables the background of the sidebar if you disabled the background of everything.
'';
};
italic = mkDefaultOpt {
type = types.bool;
description = "Enables/disables italics.";
}; };
}; };
} }