Add theme support to nixCats
This commit is contained in:
@@ -1,7 +1,19 @@
|
||||
{ inputs, config, ... }:
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (inputs.nixCats) utils;
|
||||
luaPath = ./.;
|
||||
|
||||
themeConfig =
|
||||
config.theme.neovim or {
|
||||
plugin = null;
|
||||
setup = "";
|
||||
};
|
||||
|
||||
categoryDefinitions =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
@@ -47,11 +59,13 @@ let
|
||||
};
|
||||
|
||||
startupPlugins = {
|
||||
general = with pkgs.vimPlugins; [
|
||||
lz-n
|
||||
plenary-nvim
|
||||
catppuccin-nvim
|
||||
];
|
||||
general =
|
||||
with pkgs.vimPlugins;
|
||||
[
|
||||
lz-n
|
||||
plenary-nvim
|
||||
]
|
||||
++ (lib.optional (themeConfig.plugin != null) themeConfig.plugin);
|
||||
};
|
||||
|
||||
optionalPlugins = {
|
||||
@@ -86,7 +100,9 @@ let
|
||||
render-markdown-nvim
|
||||
|
||||
colorful-menu-nvim
|
||||
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
sharedLibraries = {
|
||||
@@ -132,6 +148,13 @@ let
|
||||
nixos_options = ''(builtins.getFlake "path://${config.var.configDirectory}").nixosConfigurations.${toString config.var.hostname}.options'';
|
||||
home_manager_options = ''(builtins.getFlake "path://${config.var.configDirectory}").nixosConfigurations.${toString config.var.hostname}.options.home-manager.users.type.getSubOptions []'';
|
||||
};
|
||||
|
||||
themeSetup = themeConfig.setup;
|
||||
|
||||
# Pass only base00-base0F to neovim
|
||||
stylixColors = lib.filterAttrs (
|
||||
k: v: builtins.match "base0[0-9A-F]" k != null
|
||||
) config.lib.stylix.colors.withHashtag;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,49 +1,73 @@
|
||||
require("lz.n").load({
|
||||
-- {
|
||||
-- "catppuccin-nvim",
|
||||
-- event = "VimEnter",
|
||||
-- after = function()
|
||||
-- require("catppuccin").setup({
|
||||
-- flavour = "mocha",
|
||||
-- term_colors = true,
|
||||
-- dim_inactive = {
|
||||
-- enabled = true,
|
||||
-- shade = "dark",
|
||||
-- percentage = 0.15,
|
||||
-- },
|
||||
-- integrations = {
|
||||
-- gitsigns = true,
|
||||
-- telescope = true,
|
||||
-- treesitter = true,
|
||||
-- treesitter_context = true,
|
||||
-- markdown = true,
|
||||
-- which_key = true,
|
||||
-- blink_cmp = {
|
||||
-- style = "bordered",
|
||||
-- },
|
||||
-- },
|
||||
--
|
||||
-- native_lsp = {
|
||||
-- enabled = true,
|
||||
-- virtual_text = {
|
||||
-- errors = { "italic" },
|
||||
-- hints = { "italic" },
|
||||
-- warnings = { "italic" },
|
||||
-- information = { "italic" },
|
||||
-- },
|
||||
-- underlines = {
|
||||
-- errors = { "underline" },
|
||||
-- hints = { "underline" },
|
||||
-- warnings = { "underline" },
|
||||
-- information = { "underline" },
|
||||
-- },
|
||||
-- inlay_hints = {
|
||||
-- background = true,
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
--
|
||||
-- vim.cmd.colorscheme("catppuccin")
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
"catppuccin-nvim",
|
||||
"theme-loader",
|
||||
event = "VimEnter",
|
||||
after = function()
|
||||
require("catppuccin").setup({
|
||||
flavour = "mocha",
|
||||
term_colors = true,
|
||||
dim_inactive = {
|
||||
enabled = true,
|
||||
shade = "dark",
|
||||
percentage = 0.15,
|
||||
},
|
||||
integrations = {
|
||||
gitsigns = true,
|
||||
telescope = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
markdown = true,
|
||||
which_key = true,
|
||||
blink_cmp = {
|
||||
style = "bordered",
|
||||
},
|
||||
},
|
||||
load = function()
|
||||
local theme_code = nixCats.extra("themeSetup")
|
||||
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
inlay_hints = {
|
||||
background = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd.colorscheme("catppuccin")
|
||||
if theme_code and theme_code ~= "" then
|
||||
local func, err = loadstring(theme_code)
|
||||
if func then
|
||||
func()
|
||||
else
|
||||
print("Error loading theme code: " .. err)
|
||||
end
|
||||
else
|
||||
local colors = nixCats.extra("stylixColors")
|
||||
if colors then
|
||||
require("lz.n").trigger_load("mini.nvim")
|
||||
require("mini.base16").setup({
|
||||
palette = colors,
|
||||
})
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -26,6 +26,16 @@
|
||||
transparentButtons = false;
|
||||
floating = true;
|
||||
};
|
||||
|
||||
neovim = {
|
||||
plugin = pkgs.vimPlugins.tokyonight-nvim;
|
||||
setup = ''
|
||||
require("tokyonight").setup({
|
||||
style = "night"
|
||||
})
|
||||
vim.cmd.colorscheme("tokyonight")
|
||||
'';
|
||||
};
|
||||
};
|
||||
description = "Theme configuration options";
|
||||
};
|
||||
@@ -86,19 +96,19 @@
|
||||
};
|
||||
|
||||
polarity = "dark";
|
||||
# image = pkgs.fetchurl {
|
||||
# url = "https://raw.githubusercontent.com/anotherhadi/awesome-wallpapers/refs/heads/main/app/static/wallpapers/leef_dark_purple_minimalist.png";
|
||||
# sha256 = "sha256-q6ufFdC/tMSb+mllw7XhilkAObemXXyps2SBlnMt7mY=";
|
||||
# };
|
||||
image = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/anotherhadi/awesome-wallpapers/refs/heads/main/app/static/wallpapers/leef_dark_purple_minimalist.png";
|
||||
sha256 = "sha256-q6ufFdC/tMSb+mllw7XhilkAObemXXyps2SBlnMt7mY=";
|
||||
};
|
||||
|
||||
# image = pkgs.fetchurl {
|
||||
# url = "https://raw.githubusercontent.com/anotherhadi/awesome-wallpapers/refs/heads/main/app/static/wallpapers/alone-cloud_dark.png";
|
||||
# sha256 = "sha256-L4Esjo6LEwhBEN29WX445F+54rlnvOtAMKsQz8Qpyuc=";
|
||||
# };
|
||||
|
||||
image = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/anotherhadi/awesome-wallpapers/refs/heads/main/app/static/wallpapers/the-cloud-is-hidding-the-moon_dark.png";
|
||||
sha256 = "sha256-EEH2cHsVromD+X5VFF3YObNuSSRbDnpfqEN6fjCztbc=";
|
||||
};
|
||||
# image = pkgs.fetchurl {
|
||||
# url = "https://raw.githubusercontent.com/anotherhadi/awesome-wallpapers/refs/heads/main/app/static/wallpapers/the-cloud-is-hidding-the-moon_dark.png";
|
||||
# sha256 = "sha256-EEH2cHsVromD+X5VFF3YObNuSSRbDnpfqEN6fjCztbc=";
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user