forked from nix-community/nixvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdracula.nix
87 lines (78 loc) · 2.37 KB
/
dracula.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
lib,
config,
pkgs,
...
}:
let
inherit (lib) types;
cfg = config.colorschemes.dracula;
in
{
options = {
colorschemes.dracula = {
enable = lib.mkEnableOption "dracula";
package = lib.mkPackageOption pkgs "dracula" {
default = [
"vimPlugins"
"dracula-vim"
];
};
bold = lib.mkOption {
type = types.bool;
default = true;
description = "Include bold attributes in highlighting";
};
italic = lib.mkOption {
type = types.bool;
default = true;
description = "Include italic attributes in highlighting";
};
underline = lib.mkOption {
type = types.bool;
default = true;
description = "Include underline attributes in highlighting";
};
undercurl = lib.mkOption {
type = types.bool;
default = true;
description = "Include undercurl attributes in highlighting (only if underline enabled)";
};
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 = lib.mkOption {
type = types.bool;
default = false;
description = "Use high-contrast color when in diff mode";
};
inverse = lib.mkOption {
type = types.bool;
default = true;
description = "Include inverse attributes in highlighting";
};
colorterm = lib.mkOption {
type = types.bool;
default = true;
description = "Include background fill colors";
};
};
};
config = lib.mkIf cfg.enable {
colorscheme = "dracula";
extraPlugins = [ cfg.package ];
globals = {
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 = lib.mkDefault true;
};
}