2023-02-20 11:42:13 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
2022-09-18 11:19:23 +01:00
|
|
|
cfg = config.colorschemes.base16;
|
2023-02-20 11:42:13 +01:00
|
|
|
helpers = import ../helpers.nix {inherit lib;};
|
2021-02-10 14:49:33 +00:00
|
|
|
themes = import ./base16-list.nix;
|
2023-02-20 11:42:13 +01:00
|
|
|
in {
|
2021-02-10 14:20:36 +00:00
|
|
|
options = {
|
2022-09-18 11:19:23 +01:00
|
|
|
colorschemes.base16 = {
|
2023-01-22 03:32:08 +00:00
|
|
|
enable = mkEnableOption "base16";
|
2021-02-10 14:49:33 +00:00
|
|
|
|
2023-01-25 19:46:49 +01:00
|
|
|
package = helpers.mkPackageOption "base16" pkgs.vimPlugins.base16-vim;
|
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.";
|
|
|
|
};
|
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-02-20 11:42:13 +01: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
|
|
|
};
|
|
|
|
}
|