From f8c3a9dbefcfdd94818196019dd31894c3df6b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Fri, 13 Dec 2024 13:42:39 +0100 Subject: [PATCH] neovim: use bas16 manually --- configs/neovim.nix | 6 +++++- lib/vim/init.vim | 2 -- packages/vim.nix | 16 ++++++++++++++++ systems/fatteh/configuration.nix | 2 +- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/configs/neovim.nix b/configs/neovim.nix index 2be26ed..33739b0 100644 --- a/configs/neovim.nix +++ b/configs/neovim.nix @@ -1,6 +1,7 @@ { pkgs, niveumPackages, + config, ... }: { environment.variables.EDITOR = pkgs.lib.mkForce "nvim"; @@ -35,7 +36,10 @@ environment.systemPackages = [ (pkgs.writers.writeDashBin "vim" ''neovim "$@"'') - niveumPackages.vim + (niveumPackages.vim.override { + stylixColors = config.lib.stylix.colors; + colorscheme = if config.networking.hostName == "fatteh" then "base16-grayscale-light" else "base16-grayscale-dark"; + }) # language servers pkgs.pyright diff --git a/lib/vim/init.vim b/lib/vim/init.vim index c83d243..1f1479a 100644 --- a/lib/vim/init.vim +++ b/lib/vim/init.vim @@ -3,8 +3,6 @@ vnoremap a= :Tabularize /= vnoremap a; :Tabularize /:: vnoremap a- :Tabularize /-> -colorscheme dim - " noremap h :split " noremap v :vsplit noremap gs :Git diff --git a/packages/vim.nix b/packages/vim.nix index 7f5535e..ec726cc 100644 --- a/packages/vim.nix +++ b/packages/vim.nix @@ -4,6 +4,10 @@ fetchFromGitHub, vimUtils, niveumPackages, + writeText, + stylixColors ? null, + colorscheme ? null, + lib, ... }: (neovim.override { configure = { @@ -12,9 +16,21 @@ source ${../lib/vim/init.vim} let g:snippet_directory = '${vimPlugins.friendly-snippets}' luafile ${../lib/vim/init.lua} + '' + lib.optionalString (stylixColors != null) (with stylixColors.withHashtag; '' + luafile ${writeText "colors.lua" '' + require('base16-colorscheme').setup({ + base00 = '${base00}', base01 = '${base01}', base02 = '${base02}', base03 = '${base03}', + base04 = '${base04}', base05 = '${base05}', base06 = '${base06}', base07 = '${base07}', + base08 = '${base08}', base09 = '${base09}', base0A = '${base0A}', base0B = '${base0B}', + base0C = '${base0C}', base0D = '${base0D}', base0E = '${base0E}', base0F = '${base0F}' + }) + ''} + '') + lib.optionalString (colorscheme != null) '' + colorscheme ${colorscheme} ''; packages.nvim = with vimPlugins; { start = [ + base16-nvim nvim-cmp cmp-buffer cmp-path diff --git a/systems/fatteh/configuration.nix b/systems/fatteh/configuration.nix index e7c749a..2e28254 100644 --- a/systems/fatteh/configuration.nix +++ b/systems/fatteh/configuration.nix @@ -20,7 +20,7 @@ in { services.illum.enable = true; - stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/selenized-light.yaml"; + stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/grayscale-light.yaml"; age.secrets = { retiolum-rsa = {