feat: nvim integration

This commit is contained in:
2024-04-07 19:10:17 +02:00
parent 040515003f
commit 52abd8f311
5 changed files with 58 additions and 47 deletions

View File

@@ -11,7 +11,10 @@ let
cfg = config.theme.base16;
in
{
imports = [ ./integrations/kitty ];
imports = [
./integrations/kitty
./integrations/neovim
];
options.theme.base16 = {
enable = mkEnableOption "Enable a global base16 theme";

View File

@@ -0,0 +1,21 @@
-- Base16 {{scheme-name}} - nvim color config
-- Scheme by {{scheme-author}}
require('base16-colorscheme').setup({
base00 = '#{{base00-hex}}',
base01 = '#{{base01-hex}}',
base02 = '#{{base02-hex}}',
base03 = '#{{base03-hex}}',
base04 = '#{{base04-hex}}',
base05 = '#{{base05-hex}}',
base06 = '#{{base06-hex}}',
base07 = '#{{base07-hex}}',
base08 = '#{{base08-hex}}',
base09 = '#{{base09-hex}}',
base0A = '#{{base0A-hex}}',
base0B = '#{{base0B-hex}}',
base0C = '#{{base0C-hex}}',
base0D = '#{{base0D-hex}}',
base0E = '#{{base0E-hex}}',
base0F = '#{{base0F-hex}}'
})

View File

@@ -0,0 +1,33 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.theme.base16;
in
{
config = mkIf cfg.enable {
programs.nixvim = {
extraConfigLuaPre = ''
require('flavours-colors')
'';
extraPlugins = [ pkgs.vimPlugins.base16-nvim ];
};
xdg.configFile."flavours/templates/nvim/templates/default.mustache".source = ./default.mustache;
theme.base16.options.items = [
{
file = "${config.xdg.configHome}/nvim/lua/flavours-colors.lua";
template = "nvim";
#hook = "kill -SIGUSR1 $(pgrep kitty)";
rewrite = true;
}
];
};
}