2023-09-10 15:59:46 +05:30
|
|
|
{
|
|
|
|
lib,
|
2023-11-06 15:04:08 +01:00
|
|
|
config,
|
|
|
|
pkgs,
|
2023-09-10 15:59:46 +05:30
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
2024-08-22 10:03:02 -05:00
|
|
|
inherit (lib) types;
|
2023-09-10 15:59:46 +05:30
|
|
|
cfg = config.colorschemes.dracula;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
colorschemes.dracula = {
|
2024-08-22 10:03:02 -05:00
|
|
|
enable = lib.mkEnableOption "dracula";
|
2023-09-10 15:59:46 +05:30
|
|
|
|
2024-09-04 22:00:43 +01:00
|
|
|
package = lib.mkPackageOption pkgs "dracula" {
|
|
|
|
default = [
|
|
|
|
"vimPlugins"
|
|
|
|
"dracula-vim"
|
|
|
|
];
|
|
|
|
};
|
2023-09-10 15:59:46 +05:30
|
|
|
|
2024-08-22 10:03:02 -05:00
|
|
|
bold = lib.mkOption {
|
2023-09-10 15:59:46 +05:30
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Include bold attributes in highlighting";
|
|
|
|
};
|
2024-08-22 10:03:02 -05:00
|
|
|
italic = lib.mkOption {
|
2023-09-10 15:59:46 +05:30
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Include italic attributes in highlighting";
|
|
|
|
};
|
2024-08-22 10:03:02 -05:00
|
|
|
underline = lib.mkOption {
|
2023-09-10 15:59:46 +05:30
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Include underline attributes in highlighting";
|
|
|
|
};
|
2024-08-22 10:03:02 -05:00
|
|
|
undercurl = lib.mkOption {
|
2023-09-10 15:59:46 +05:30
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Include undercurl attributes in highlighting (only if underline enabled)";
|
|
|
|
};
|
|
|
|
|
2024-08-22 10:03:02 -05:00
|
|
|
fullSpecialAttrsSupport = lib.mkOption {
|
2023-09-10 15:59:46 +05:30
|
|
|
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";
|
|
|
|
};
|
|
|
|
|
2024-08-22 10:03:02 -05:00
|
|
|
highContrastDiff = lib.mkOption {
|
2023-09-10 15:59:46 +05:30
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Use high-contrast color when in diff mode";
|
|
|
|
};
|
|
|
|
|
2024-08-22 10:03:02 -05:00
|
|
|
inverse = lib.mkOption {
|
2023-09-10 15:59:46 +05:30
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Include inverse attributes in highlighting";
|
|
|
|
};
|
|
|
|
|
2024-08-22 10:03:02 -05:00
|
|
|
colorterm = lib.mkOption {
|
2023-09-10 15:59:46 +05:30
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Include background fill colors";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-08-22 10:03:02 -05:00
|
|
|
config = lib.mkIf cfg.enable {
|
2023-09-10 15:59:46 +05:30
|
|
|
colorscheme = "dracula";
|
|
|
|
extraPlugins = [ cfg.package ];
|
|
|
|
|
|
|
|
globals = {
|
2024-08-22 10:03:02 -05:00
|
|
|
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;
|
2023-09-10 15:59:46 +05:30
|
|
|
};
|
|
|
|
|
2024-08-22 10:03:02 -05:00
|
|
|
opts.termguicolors = lib.mkDefault true;
|
2023-09-10 15:59:46 +05:30
|
|
|
};
|
|
|
|
}
|