feat(nvim): nixify theming (and add 'vscode' theme)
check / lint (push) Successful in 17s

This commit is contained in:
2026-08-25 23:46:47 +02:00
parent 5f8f8c4251
commit 4004d9e361
8 changed files with 134 additions and 82 deletions
@@ -0,0 +1,14 @@
local function overrides()
local colors = require("vscode.colors").get_colors()
vim.api.nvim_set_hl(0, "NormalFloat", { bg = colors.vscLeftDark })
vim.api.nvim_set_hl(0, "FloatBorder", { fg = colors.vscSplitDark, bg = colors.vscLeftDark })
end
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "vscode",
callback = overrides,
})
if vim.g.colors_name == "vscode" then
overrides()
end
@@ -1 +0,0 @@
vim.cmd("colorscheme zenwritten")
+11 -4
View File
@@ -71,8 +71,12 @@
categoryDefinitions = categoryDefinitions =
{ {
pkgs, pkgs,
categories,
... ...
}: }:
let
themes = import ./themes.nix pkgs;
in
{ {
lspsAndRuntimeDeps = with pkgs; { lspsAndRuntimeDeps = with pkgs; {
general = [ general = [
@@ -113,7 +117,9 @@
}; };
startupPlugins = { startupPlugins = {
general = with pkgs.vimPlugins; [ general =
with pkgs.vimPlugins;
[
## plug ## plug
vim-plug vim-plug
vim-sandwich vim-sandwich
@@ -155,9 +161,8 @@
plenary-nvim plenary-nvim
nui-nvim nui-nvim
trouble-nvim trouble-nvim
pkgs.neovimPlugins.shipwright-nvim
lush-nvim lush-nvim
zenbones-nvim pkgs.neovimPlugins.shipwright-nvim
nvim-treesitter.withAllGrammars nvim-treesitter.withAllGrammars
nvim-treesitter-textobjects nvim-treesitter-textobjects
# nvim-treesitter-context # nvim-treesitter-context
@@ -182,7 +187,8 @@
rustaceanvim rustaceanvim
# pkgs.neovimPlugins.m-taskwarrior-d-nvim # pkgs.neovimPlugins.m-taskwarrior-d-nvim
claude-code-nvim claude-code-nvim
]; ]
++ themes.${categories.colorscheme or "zenwritten"};
}; };
optionalPlugins = { optionalPlugins = {
@@ -207,6 +213,7 @@
}; };
categories = { categories = {
general = true; general = true;
colorscheme = "zenwritten";
}; };
}; };
}; };
+1 -2
View File
@@ -16,5 +16,4 @@ require("diagnostic")
require("utils") require("utils")
require("zk") require("zk")
require("reload") require("reload")
require("theme")
vim.opt.background = "dark"
+8
View File
@@ -0,0 +1,8 @@
vim.opt.background = "dark"
if vim.g.vscode then
return
end
vim.g.zenwritten_compat = 1
vim.cmd.colorscheme(require("nixCatsUtils").getCatOrDefault("colorscheme", "zenwritten"))
+4
View File
@@ -0,0 +1,4 @@
pkgs: {
vscode = [ pkgs.vimPlugins.vscode-nvim ];
zenwritten = [ pkgs.vimPlugins.zenbones-nvim ];
}
+4 -1
View File
@@ -70,7 +70,10 @@
music.enable = true; music.enable = true;
my.dconf.enable = true; my.dconf.enable = true;
my.stylix.enable = true; my.stylix.enable = true;
nvim.enable = true; nvim = {
enable = true;
colorscheme = "vscode";
};
pandoc.enable = true; pandoc.enable = true;
shell.enable = true; shell.enable = true;
taskwarrior.enable = true; taskwarrior.enable = true;
+26 -8
View File
@@ -1,15 +1,28 @@
{ {
config,
lib,
pkgs,
inputs, inputs,
pkgs,
lib,
config,
... ...
}: }:
let
themes = import "${inputs.nvim}/themes.nix" pkgs;
plugins = themes.${config.nvim.colorscheme};
in
{ {
options.nvim.enable = lib.mkEnableOption "nvim"; imports = [ inputs.nvim.homeModules.default ];
options.nvim.colorscheme = lib.mkOption {
type = lib.types.enum (lib.attrNames themes);
default = "zenwritten";
};
config = lib.mkIf config.nvim.enable { config = lib.mkIf config.nvim.enable {
nvim.packageDefinitions.merge.nvim = _: {
categories.colorscheme = config.nvim.colorscheme;
};
home = { home = {
sessionVariables = { sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";
@@ -19,10 +32,15 @@
PAGER = "nvimpager"; PAGER = "nvimpager";
MANWIDTH = "80"; MANWIDTH = "80";
}; };
packages = with pkgs; [ packages = with pkgs; [ nvimpager ];
inputs.nvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim
nvimpager
];
}; };
xdg.configFile."nvimpager/init.lua".text = ''
vim.opt.clipboard = "unnamedplus"
vim.opt.background = "dark"
vim.g.zenwritten_compat = 1
${lib.concatMapStringsSep "\n" (plugin: ''vim.opt.runtimepath:append("${plugin}")'') plugins}
vim.cmd.colorscheme("${config.nvim.colorscheme}")
'';
}; };
} }