Skip to content

Commit

Permalink
neovim: fix transparency configuration
Browse files Browse the repository at this point in the history
Closes danth#599
  • Loading branch information
soulsoiledit committed Nov 15, 2024
1 parent 5ab1207 commit 4fb04a3
Showing 1 changed file with 33 additions and 28 deletions.
61 changes: 33 additions & 28 deletions modules/neovim/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,50 @@
programs.neovim =
let
cfg = config.stylix.targets.neovim;
transparencyCfg = lib.mkMerge [
(lib.mkIf cfg.transparentBackground.main ''
vim.cmd.highlight({ "Normal", "guibg=NONE", "ctermbg=NONE" })
vim.cmd.highlight({ "NonText", "guibg=NONE", "ctermbg=NONE" })
'')
(lib.mkIf cfg.transparentBackground.signColumn ''
vim.cmd.highlight({ "SignColumn", "guibg=NONE", "ctermbg=NONE" })
'')
];
in
{
plugins = [
(lib.mkIf (cfg.plugin == "base16-nvim") {
plugin = pkgs.vimPlugins.base16-nvim;
type = "lua";
config = with config.lib.stylix.colors.withHashtag; ''
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.mkIf (cfg.plugin == "mini.base16") {
plugin = pkgs.vimPlugins.mini-nvim;
type = "lua";
config = with config.lib.stylix.colors.withHashtag; ''
require('mini.base16').setup({
palette = {
config = lib.mkMerge [
(with config.lib.stylix.colors.withHashtag; ''
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}'
}
})
'';
})
'')
transparencyCfg
];
})
(lib.mkIf (cfg.plugin == "mini.base16") {
plugin = pkgs.vimPlugins.mini-nvim;
type = "lua";
config = lib.mkMerge [
(with config.lib.stylix.colors.withHashtag; ''
require('mini.base16').setup({
palette = {
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}'
}
})
'')
transparencyCfg
];
})
];

extraLuaConfig = lib.mkMerge [
(lib.mkIf cfg.transparentBackground.main ''
vim.cmd.highlight({ "Normal", "guibg=NONE", "ctermbg=NONE" })
vim.cmd.highlight({ "NonText", "guibg=NONE", "ctermbg=NONE" })
'')
(lib.mkIf cfg.transparentBackground.signColumn ''
vim.cmd.highlight({ "SignColumn", "guibg=NONE", "ctermbg=NONE" })
'')
];
};
};
Expand Down

0 comments on commit 4fb04a3

Please sign in to comment.