-
-
Notifications
You must be signed in to change notification settings - Fork 296
/
Copy pathcatppuccin.nix
320 lines (282 loc) · 7.41 KB
/
catppuccin.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
{
lib,
helpers,
config,
pkgs,
...
}:
with lib;
helpers.neovim-plugin.mkNeovimPlugin config {
name = "catppuccin";
isColorscheme = true;
defaultPackage = pkgs.vimPlugins.catppuccin-nvim;
maintainers = [ maintainers.GaetanLepage ];
# TODO introduced 2024-03-27: remove 2024-05-27
optionsRenamedToSettings = [
"flavour"
[
"background"
"light"
]
[
"background"
"dark"
]
"transparentBackground"
[
"dimInactive"
"enabled"
]
[
"dimInactive"
"shade"
]
[
"dimInactive"
"percentage"
]
[
"styles"
"comments"
]
[
"styles"
"conditionals"
]
[
"styles"
"loops"
]
[
"styles"
"functions"
]
[
"styles"
"keywords"
]
[
"styles"
"strings"
]
[
"styles"
"variables"
]
[
"styles"
"numbers"
]
[
"styles"
"booleans"
]
[
"styles"
"properties"
]
[
"styles"
"types"
]
[
"styles"
"operators"
]
"colorOverrides"
"customHighlights"
"integrations"
];
imports =
mapAttrsToList
(
old: new:
mkRenamedOptionModule
[
"colorschemes"
"catppuccin"
old
]
[
"colorschemes"
"catppuccin"
"settings"
new
]
)
{
showBufferEnd = "show_end_of_buffer";
terminalColors = "term_colors";
disableItalic = "no_italic";
disableBold = "no_bold";
disableUnderline = "no_underline";
};
settingsOptions =
let
flavours = [
"latte"
"mocha"
"frappe"
"macchiato"
];
in
{
compile_path = helpers.defaultNullOpts.mkStr {
__raw = "vim.fn.stdpath 'cache' .. '/catppuccin'";
} "Set the compile cache directory.";
flavour = helpers.mkNullOrOption (types.enum (flavours ++ [ "auto" ])) ''
Theme flavour.
'';
background =
let
mkBackgroundStyle =
name:
helpers.defaultNullOpts.mkEnumFirstDefault flavours ''
Background for `${name}` background.
'';
in
{
light = mkBackgroundStyle "light";
dark = mkBackgroundStyle "dark";
};
transparent_background = helpers.defaultNullOpts.mkBool false ''
Enable Transparent background.
'';
show_end_of_buffer = helpers.defaultNullOpts.mkBool false ''
Show the '~' characters after the end of buffers.
'';
term_colors = helpers.defaultNullOpts.mkBool false ''
Configure the colors used when opening a :terminal in Neovim.
'';
dim_inactive = {
enabled = helpers.defaultNullOpts.mkBool false ''
If true, dims the background color of inactive window or buffer or split.
'';
shade = helpers.defaultNullOpts.mkStr "dark" ''
Sets the shade to apply to the inactive split or window or buffer.
'';
percentage = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.15 ''
percentage of the shade to apply to the inactive window, split or buffer.
'';
};
no_italic = helpers.defaultNullOpts.mkBool false ''
Force no italic.
'';
no_bold = helpers.defaultNullOpts.mkBool false ''
Force no bold.
'';
no_underline = helpers.defaultNullOpts.mkBool false ''
Force no underline.
'';
styles = {
comments = helpers.defaultNullOpts.mkListOf types.str [ "italic" ] ''
Define comments highlight properties.
'';
conditionals = helpers.defaultNullOpts.mkListOf types.str [ "italic" ] ''
Define conditionals highlight properties.
'';
loops = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define loops highlight properties.
'';
functions = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define functions highlight properties.
'';
keywords = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define keywords highlight properties.
'';
strings = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define strings highlight properties.
'';
variables = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define variables highlight properties.
'';
numbers = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define numbers highlight properties.
'';
booleans = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define booleans highlight properties.
'';
properties = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define properties highlight properties.
'';
types = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define types highlight properties.
'';
operators = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Define operators highlight properties.
'';
};
color_overrides = genAttrs (flavours ++ [ "all" ]) (
flavour:
helpers.defaultNullOpts.mkAttrsOf types.str { } (
if flavour == "all" then
"Override colors for all the flavours."
else
"Override colors for the ${flavour} flavour."
)
);
custom_highlights = helpers.mkNullOrStrLuaFnOr (with types; attrsOf anything) ''
Override specific highlight groups to use other groups or a hex color.
You can provide either a lua function or directly an attrs.
Example:
```lua
function(colors)
return {
Comment = { fg = colors.flamingo },
["@constant.builtin"] = { fg = colors.peach, style = {} },
["@comment"] = { fg = colors.surface2, style = { "italic" } },
}
end
```
Default: `{}`
'';
default_integrations = helpers.defaultNullOpts.mkBool true ''
Some integrations are enabled by default, you can control this behaviour with this option.
'';
integrations = helpers.mkNullOrOption (with types; attrsOf anything) ''
Catppuccin provides theme support for other plugins in the Neovim ecosystem and extended
Neovim functionality through _integrations_.
To enable/disable an integration you just need to set it to `true`/`false`.
Example:
```nix
{
cmp = true;
gitsigns = true;
nvimtree = true;
treesitter = true;
notify = false;
mini = {
enabled = true;
indentscope_color = "";
};
}
```
Default: see plugin source.
'';
};
settingsExample = {
flavour = "mocha";
disable_underline = true;
term_colors = true;
color_overrides.mocha.base = "#1e1e2f";
styles = {
booleans = [
"bold"
"italic"
];
conditionals = [ "bold" ];
};
integrations = {
cmp = true;
gitsigns = true;
nvimtree = true;
treesitter = true;
notify = false;
mini = {
enabled = true;
indentscope_color = "";
};
};
};
extraConfig = cfg: { opts.termguicolors = mkDefault true; };
}