forked from nix-community/nixvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoimandres.nix
63 lines (52 loc) · 1.75 KB
/
poimandres.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
{
lib,
helpers,
pkgs,
config,
...
}:
with lib; let
cfg = config.colorschemes.poimandres;
in {
options = {
colorschemes.poimandres =
helpers.extraOptionsOptions
// {
enable = mkEnableOption "poimandres";
package = helpers.mkPackageOption "poimandres" pkgs.vimPlugins.poimandres-nvim;
boldVertSplit = helpers.defaultNullOpts.mkBool false "bold vertical split";
darkVariant = helpers.defaultNullOpts.mkStr "main" "dark variant";
disableBackground = helpers.defaultNullOpts.mkBool false "Whether to disable the background.";
disableFloatBackground =
helpers.defaultNullOpts.mkBool false
"Whether to disable the float background.";
disableItalics = helpers.defaultNullOpts.mkBool false "Whether to disable italics.";
dimNcBackground = helpers.defaultNullOpts.mkBool false "Dim NC background";
groups =
helpers.mkNullOrOption (with types; attrsOf (either str (attrsOf str)))
"groups";
highlightGroups = helpers.mkNullOrOption types.attrs "highlight groups";
};
};
config = let
setupOptions =
{
bold_vert_split = cfg.boldVertSplit;
dark_variant = cfg.darkVariant;
disable_background = cfg.disableBackground;
disable_float_background = cfg.disableFloatBackground;
disable_italics = cfg.disableItalics;
dim_nc_background = cfg.dimNcBackground;
inherit (cfg) groups;
highlight_groups = cfg.highlightGroups;
}
// cfg.extraOptions;
in
mkIf cfg.enable {
colorscheme = "poimandres";
extraPlugins = [cfg.package];
extraConfigLuaPre = ''
require("poimandres").setup(${helpers.toLuaObject setupOptions})
'';
};
}