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

42 lines
1.1 KiB
Nix
Raw Normal View History

{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.programs.nixvim.colorschemes.base16;
2021-02-10 14:49:33 +00:00
themes = import ./base16-list.nix;
in {
options = {
programs.nixvim.colorschemes.base16 = {
enable = mkEnableOption "Enable base16";
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";
};
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.";
};
};
};
config = mkIf cfg.enable {
programs.nixvim = {
2021-02-10 14:49:33 +00:00
colorscheme = "base16-${cfg.colorscheme}";
extraPlugins = [ pkgs.vimPlugins.base16-vim ];
2021-02-10 14:49:33 +00:00
plugins.airline.theme = mkIf (cfg.setUpBar) "base16";
plugins.lightline.colorscheme = null;
options.termguicolors = mkIf cfg.useTruecolor true;
};
};
}