2021-02-10 14:20:36 +00:00
|
|
|
{ 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;
|
2021-02-10 14:20:36 +00:00
|
|
|
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.";
|
|
|
|
};
|
2021-02-10 14:20:36 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs.nixvim = {
|
2021-02-10 14:49:33 +00:00
|
|
|
colorscheme = "base16-${cfg.colorscheme}";
|
2021-02-10 14:20:36 +00:00
|
|
|
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;
|
2021-02-10 14:20:36 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|