plugins/colorschemes: remove with lib;

This commit is contained in:
Austin Horstman 2024-08-22 10:03:02 -05:00
parent fba168aba7
commit 77cbd0313d
No known key found for this signature in database
13 changed files with 94 additions and 101 deletions

View file

@ -4,57 +4,57 @@
pkgs,
...
}:
with lib;
let
inherit (lib) types;
cfg = config.colorschemes.dracula;
in
{
options = {
colorschemes.dracula = {
enable = mkEnableOption "dracula";
enable = lib.mkEnableOption "dracula";
package = lib.nixvim.mkPluginPackageOption "dracula" pkgs.vimPlugins.dracula-vim;
bold = mkOption {
bold = lib.mkOption {
type = types.bool;
default = true;
description = "Include bold attributes in highlighting";
};
italic = mkOption {
italic = lib.mkOption {
type = types.bool;
default = true;
description = "Include italic attributes in highlighting";
};
underline = mkOption {
underline = lib.mkOption {
type = types.bool;
default = true;
description = "Include underline attributes in highlighting";
};
undercurl = mkOption {
undercurl = lib.mkOption {
type = types.bool;
default = true;
description = "Include undercurl attributes in highlighting (only if underline enabled)";
};
fullSpecialAttrsSupport = mkOption {
fullSpecialAttrsSupport = lib.mkOption {
type = types.bool;
default = false;
description = "Explicitly declare full support for special attributes. On terminal emulators, set to 1 to allow underline/undercurl highlights without changing the foreground color";
};
highContrastDiff = mkOption {
highContrastDiff = lib.mkOption {
type = types.bool;
default = false;
description = "Use high-contrast color when in diff mode";
};
inverse = mkOption {
inverse = lib.mkOption {
type = types.bool;
default = true;
description = "Include inverse attributes in highlighting";
};
colorterm = mkOption {
colorterm = lib.mkOption {
type = types.bool;
default = true;
description = "Include background fill colors";
@ -62,21 +62,21 @@ in
};
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
colorscheme = "dracula";
extraPlugins = [ cfg.package ];
globals = {
dracula_bold = mkIf (!cfg.bold) 0;
dracula_italic = mkIf (!cfg.italic) 0;
dracula_underline = mkIf (!cfg.underline) 0;
dracula_undercurl = mkIf (!cfg.undercurl) 0;
dracula_full_special_attrs_support = mkIf cfg.fullSpecialAttrsSupport 1;
dracula_high_contrast_diff = mkIf cfg.highContrastDiff 1;
dracula_inverse = mkIf (!cfg.inverse) 0;
dracula_colorterm = mkIf (!cfg.colorterm) 0;
dracula_bold = lib.mkIf (!cfg.bold) 0;
dracula_italic = lib.mkIf (!cfg.italic) 0;
dracula_underline = lib.mkIf (!cfg.underline) 0;
dracula_undercurl = lib.mkIf (!cfg.undercurl) 0;
dracula_full_special_attrs_support = lib.mkIf cfg.fullSpecialAttrsSupport 1;
dracula_high_contrast_diff = lib.mkIf cfg.highContrastDiff 1;
dracula_inverse = lib.mkIf (!cfg.inverse) 0;
dracula_colorterm = lib.mkIf (!cfg.colorterm) 0;
};
opts.termguicolors = mkDefault true;
opts.termguicolors = lib.mkDefault true;
};
}