diff --git a/modules/home-manager/programs/nixvim/default.nix b/modules/home-manager/programs/nixvim/default.nix index 13e8749..b31fc29 100644 --- a/modules/home-manager/programs/nixvim/default.nix +++ b/modules/home-manager/programs/nixvim/default.nix @@ -1,4 +1,23 @@ { pkgs }: +let + darkman = pkgs.vimUtils.buildVimPlugin { + name = "darkman"; + src = pkgs.buildGoModule rec { + pname = "darkman.nvim"; + version = "0.0.1"; + vendorHash = "sha256-HpyKzvKVN9hVRxxca4sdWRo91H32Ha9gxitr7Qg5MY8="; + src = pkgs.fetchFromGitHub { + owner = "4e554c4c"; + repo = "darkman.nvim"; + rev = "150aa63a13837c44abd87ff20d3a806321a17b2d"; + sha256 = "sha256-ssEYdM460I1rufjgh63CEkLi4K+bEWbwku/6gQbytno="; + }; + postInstall = '' + cp -r lua $out + ''; + }; + }; +in { enable = true; defaultEditor = true; @@ -71,9 +90,25 @@ extraConfigLua = builtins.readFile ./extra-config.lua; + colorschemes.catppuccin = { + enable = true; + terminalColors = true; + transparentBackground = true; + background = { + dark = "frappe"; + light = "latte"; + }; + integrations.native_lsp.underlines = { + errors = [ "undercurl" ]; + warnings = [ "undercurl" ]; + }; + customHighlights = builtins.readFile ./custom-highlights.lua; + }; + plugins = { lualine = { enable = true; + theme = "catppuccin"; globalstatus = true; sectionSeparators = { left = ""; @@ -435,6 +470,7 @@ ]; extraPlugins = with pkgs.vimPlugins; [ vim-mergetool + darkman rest-nvim plenary-nvim actions-preview-nvim diff --git a/modules/home-manager/programs/nixvim/extra-config.lua b/modules/home-manager/programs/nixvim/extra-config.lua index 4b2cd41..ff7da83 100644 --- a/modules/home-manager/programs/nixvim/extra-config.lua +++ b/modules/home-manager/programs/nixvim/extra-config.lua @@ -1,8 +1,18 @@ +require("darkman").setup() require("cmp-npm").setup({}) require("rest-nvim").setup({}) require("actions-preview").setup({}) if vim.g.neovide then + vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "*", + callback = function() + local flavour = require("catppuccin").options.background[vim.o.background] + local palette = require("catppuccin.palettes").get_palette(flavour) + vim.cmd("hi Normal guibg=" .. palette.base) + vim.cmd("set pumblend=100") + end, + }) -- no idea why this is needed vim.opt.linespace = -1 end diff --git a/modules/home-manager/theme/default.nix b/modules/home-manager/theme/default.nix index b02a82b..5e32a42 100644 --- a/modules/home-manager/theme/default.nix +++ b/modules/home-manager/theme/default.nix @@ -11,10 +11,7 @@ let cfg = config.theme.base16; in { - imports = [ - ./integrations/kitty - ./integrations/neovim - ]; + imports = [ ./integrations/kitty ]; options.theme.base16 = { enable = mkEnableOption "Enable a global base16 theme"; diff --git a/modules/home-manager/theme/integrations/neovim/default.mustache b/modules/home-manager/theme/integrations/neovim/default.mustache deleted file mode 100644 index d1b0654..0000000 --- a/modules/home-manager/theme/integrations/neovim/default.mustache +++ /dev/null @@ -1,21 +0,0 @@ --- 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}}' -}) diff --git a/modules/home-manager/theme/integrations/neovim/default.nix b/modules/home-manager/theme/integrations/neovim/default.nix deleted file mode 100644 index 08f8b1b..0000000 --- a/modules/home-manager/theme/integrations/neovim/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - 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; - } - ]; - }; -}