base16: init plugin

This commit is contained in:
Pedro Alves 2021-02-10 14:49:33 +00:00
parent 657e5e6efb
commit f97e2f6ffc
4 changed files with 159 additions and 6 deletions

View file

@ -35,9 +35,9 @@
programs.nixvim = {
enable = true;
package = pkgs.neovim-nightly;
colorschemes.gruvbox = {
colorschemes.base16 = {
enable = true;
italics = true;
colorscheme = "ocean";
};
options.number = true;

View file

@ -0,0 +1,131 @@
# This is a list of all base16 themes
[
"3024"
"apathy"
"ashes"
"atelier-cave-light"
"atelier-cave"
"atelier-dune-light"
"atelier-dune"
"atelier-estuary-light"
"atelier-estuary"
"atelier-forest-light"
"atelier-forest"
"atelier-heath-light"
"atelier-heath"
"atelier-lakeside-light"
"atelier-lakeside"
"atelier-plateau-light"
"atelier-plateau"
"atelier-savanna-light"
"atelier-savanna"
"atelier-seaside-light"
"atelier-seaside"
"atelier-sulphurpool-light"
"atelier-sulphurpool"
"atlas"
"bespin"
"black-metal-bathory"
"black-metal-burzum"
"black-metal-dark-funeral"
"black-metal-gorgoroth"
"black-metal-immortal"
"black-metal-khold"
"black-metal-marduk"
"black-metal-mayhem"
"black-metal-nile"
"black-metal-venom"
"black-metal"
"brewer"
"bright"
"brogrammer"
"brushtrees-dark"
"brushtrees"
"chalk"
"circus"
"classic-dark"
"classic-light"
"codeschool"
"cupcake"
"cupertino"
"darktooth"
"default-dark"
"default-light"
"dracula"
"eighties"
"embers"
"flat"
"fruit-soda"
"github"
"google-dark"
"google-light"
"grayscale-dark"
"grayscale-light"
"greenscreen"
"gruvbox-dark-hard"
"gruvbox-dark-medium"
"gruvbox-dark-pale"
"gruvbox-dark-soft"
"gruvbox-light-hard"
"gruvbox-light-medium"
"gruvbox-light-soft"
"harmonic-dark"
"harmonic-light"
"heetch-light"
"heetch"
"helios"
"hopscotch"
"horizon-dark"
"ia-dark"
"ia-light"
"icy"
"irblack"
"isotope"
"macintosh"
"marrakesh"
"material-darker"
"material-lighter"
"material-palenight"
"material"
"material-vivid"
"materia"
"mellow-purple"
"mexico-light"
"mocha"
"monokai"
"nord"
"oceanicnext"
"ocean"
"onedark"
"one-light"
"outrun-dark"
"papercolor-dark"
"papercolor-light"
"paraiso"
"phd"
"pico"
"pop"
"porple"
"railscasts"
"rebecca"
"seti"
"shapeshifter"
"snazzy"
"solarflare"
"solarized-dark"
"solarized-light"
"spacemacs"
"summerfruit-dark"
"summerfruit-light"
"synth-midnight-dark"
"tomorrow-night-eighties"
"tomorrow-night"
"tomorrow"
"tube"
"twilight"
"unikitty-dark"
"unikitty-light"
"woodland"
"xcode-dusk"
"zenburn"
]

View file

@ -2,18 +2,40 @@
with lib;
let
cfg = config.programs.nixvim.colorschemes.base16;
colors = types.enum [ "bg" "red" "green" "yellow" "blue" "purple" "aqua" "gray" "fg" "bg0_h" "bg0" "bg1" "bg2" "bg3" "bg4" "gray" "orange" "bg0_s" "fg0" "fg1" "fg2" "fg3" "fg4" ];
themes = import ./base16-list.nix;
in {
options = {
programs.nixvim.colorschemes.base16 = {
enable = mkEnableOption "Enable base16";
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 = {
colorscheme = "base16-default-dark";
colorscheme = "base16-${cfg.colorscheme}";
extraPlugins = [ pkgs.vimPlugins.base16-vim ];
plugins.airline.theme = mkIf (cfg.setUpBar) "base16";
plugins.lightline.colorscheme = null;
options.termguicolors = mkIf cfg.useTruecolor true;
};
};
}

View file

@ -75,13 +75,13 @@ in {
};
config = let
configAttrs = {
configAttrs = filterAttrs (_: v: v != null) {
inherit (cfg) colorscheme active component componentFunction modeMap;
};
in mkIf cfg.enable {
programs.nixvim = {
extraPlugins = [ pkgs.vimPlugins.lightline-vim ];
globals.lightline = configAttrs;
globals.lightline = mkIf (configAttrs != {}) configAttrs;
};
};
}