nix-community.nixvim/plugins/colorschemes/base16.nix

99 lines
2.7 KiB
Nix
Raw Normal View History

{
lib,
helpers,
config,
pkgs,
...
}:
with lib; let
cfg = config.colorschemes.base16;
2021-02-10 14:49:33 +00:00
themes = import ./base16-list.nix;
in {
options = {
colorschemes.base16 = {
2023-01-22 03:32:08 +00:00
enable = mkEnableOption "base16";
2021-02-10 14:49:33 +00:00
package = helpers.mkPackageOption "base16" pkgs.vimPlugins.nvim-base16;
general: add package options (#127) * barbar: package option * Base16: package option * gruvbox: package option * nord: package option * one: package option * onedark: package option * tokyonight: package option * nvim-cmp: package option * coq: package option * lspkind: package option * helpers: added package option to mkPlugin * fugitive: package option * gitgutter: package option * gitsigns: package option * neogit: package option * ledger: package option * nix: package option * plantuml-syntax: package option * treesitter-context: package option + formatting * treesitter-refactor: package option + formatting * treesitter: package option * zig: package option * null-ls: package option * null-ls/servers: package option * lsp-lines: package option * lspsaga: package option * trouble: package option * luasnip: added description for package option * airline: package option * lightline: package option * lualine: package option * telescope: package option * telescope/frecency: package option * telescope/fzf-native: package option * telescope/media-files: package option * comment-nvim: package option * vim-commentary: package option * dashboard: package option * easyescape: package option * emmet: package option * endwise: package option * floaterm: package option * goyo: package option * intellitab: package option * mark-radar: package option * notify: package option * nvim-autopairs: package option * nvim-tree: package option * project-nvim: package option * specs: package option * startify: package option * surround: package option * undotree: package option
2023-01-19 10:45:15 +00:00
2021-02-10 14:49:33 +00:00
useTruecolor = mkOption {
type = types.bool;
default = true;
description = "Whether to use truecolor for the colorschemes. If set to false, you'll need to set up base16 in your shell.";
};
colorscheme = mkOption {
type = types.enum themes;
description = "The base16 colorscheme to use";
2022-12-29 17:34:47 +00:00
default = head themes;
2021-02-10 14:49:33 +00:00
};
setUpBar = mkOption {
type = types.bool;
default = true;
description = "Whether to install the matching plugin for your statusbar. This does nothing as of yet, waiting for upstream support.";
};
customColorScheme =
helpers.mkNullOrOption
(with types;
submodule {
options =
listToAttrs
(
map
(
colorId: rec {
name = "base0" + colorId;
value = mkOption {
type = types.str;
description = "The value for color ${name}.";
example = "#16161D";
};
}
)
["0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F"]
);
})
''
Optionaly, you can provide a table specifying your colors to the setup function.
Example:
```nix
{
base00 = "#16161D";
base01 = "#2c313c";
base02 = "#3e4451";
base03 = "#6c7891";
base04 = "#565c64";
base05 = "#abb2bf";
base06 = "#9a9bb3";
base07 = "#c5c8e6";
base08 = "#e06c75";
base09 = "#d19a66";
base0A = "#e5c07b";
base0B = "#98c379";
base0C = "#56b6c2";
base0D = "#0184bc";
base0E = "#c678dd";
base0F = "#a06949";
}
```
'';
};
};
config = mkIf cfg.enable {
colorscheme = "base16-${cfg.colorscheme}";
extraPlugins = [cfg.package];
2021-02-10 14:49:33 +00:00
2023-05-22 15:45:47 +05:30
plugins.airline.theme = mkIf cfg.setUpBar "base16";
plugins.lightline.colorscheme = null;
2021-02-10 14:49:33 +00:00
options.termguicolors = mkIf cfg.useTruecolor true;
extraConfigLua = mkIf (cfg.customColorScheme != null) ''
require('base16-colorscheme').setup(${helpers.toLuaObject cfg.customColorScheme})
'';
};
}