2021-02-10 14:20:36 +00:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
2022-09-18 11:19:23 +01:00
|
|
|
cfg = config.colorschemes.base16;
|
2021-02-10 14:49:33 +00:00
|
|
|
themes = import ./base16-list.nix;
|
2022-09-18 11:19:23 +01:00
|
|
|
in
|
|
|
|
{
|
2021-02-10 14:20:36 +00:00
|
|
|
options = {
|
2022-09-18 11:19:23 +01:00
|
|
|
colorschemes.base16 = {
|
2021-02-10 14:20:36 +00:00
|
|
|
enable = mkEnableOption "Enable base16";
|
2021-02-10 14:49:33 +00:00
|
|
|
|
2023-01-19 10:45:15 +00:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.vimPlugins.base16-vim;
|
|
|
|
description = "Plugin to use for 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";
|
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.";
|
|
|
|
};
|
2021-02-10 14:20:36 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2022-09-18 11:19:23 +01:00
|
|
|
colorscheme = "base16-${cfg.colorscheme}";
|
2023-01-19 10:45:15 +00:00
|
|
|
extraPlugins = [ cfg.package ];
|
2021-02-10 14:49:33 +00:00
|
|
|
|
2022-09-18 11:19:23 +01:00
|
|
|
plugins.airline.theme = mkIf (cfg.setUpBar) "base16";
|
|
|
|
plugins.lightline.colorscheme = null;
|
2021-02-10 14:49:33 +00:00
|
|
|
|
2022-09-18 11:19:23 +01:00
|
|
|
options.termguicolors = mkIf cfg.useTruecolor true;
|
2021-02-10 14:20:36 +00:00
|
|
|
};
|
|
|
|
}
|