Files
nixos/modules/home-manager/nixcats/default.nix
2025-12-04 15:14:09 -05:00

229 lines
6.1 KiB
Nix

{
config,
lib,
inputs,
pkgs,
...
}: let
utils = inputs.nixCats.utils;
kulala-grammer = pkgs.tree-sitter.buildGrammar {
language = "kulala_http";
version = "${pkgs.vimPlugins.kulala-nvim.version}";
src = "${pkgs.vimPlugins.kulala-nvim}/lua/tree-sitter";
generate = true;
};
in {
imports = [
inputs.nixCats.homeModule
../zk.nix
];
config = {
home.sessionVariables = {
EDITOR = "nvim";
};
nixCats = {
enable = true;
packageNames = ["nvim"];
luaPath = ./.;
# for useage of this section, refer to :h nixCats.flake.outputs.categories
categoryDefinitions.replace = {
pkgs,
settings,
categories,
extra,
name,
mkPlugin,
...
} @ packageDef: {
# lspsAndRuntimeDeps:
# this section is for dependencies that should be available
# at RUN TIME for plugins. Will be available to PATH within neovim terminal
# this includes LSPs
lspsAndRuntimeDeps = {
general = with pkgs; [
lazygit
ripgrep
fzf
];
notes = with pkgs; [
zk
];
lua = with pkgs; [
lua-language-server
stylua
];
nix = with pkgs; [
nixd
alejandra
];
go = with pkgs; [
gopls
delve
golint
golangci-lint
gotools
go-tools
go
];
typescript = with pkgs; [
vtsls
vscode-langservers-extracted
stylelint-lsp
tailwindcss-language-server
];
yaml = with pkgs; [
yaml-language-server
];
c = with pkgs; [
clang
];
csharp = with pkgs; [
omnisharp-roslyn
];
gitlab = with pkgs; [
gitlab-ci-ls
];
http = with pkgs; [
kulala-fmt
];
};
# This is for plugins that will load at startup without using packadd:
startupPlugins = {
general = with pkgs.vimPlugins; [
# lazy loading isnt required with a config this small
# but as a demo, we do it anyway.
lze
lzextras
(nvim-treesitter.withPlugins (
plugins:
nvim-treesitter.allGrammars ++ [kulala-grammer]
))
snacks-nvim
gruvbox-nvim
gruber-darker-nvim
lackluster-nvim
oxocarbon-nvim
vim-sleuth
oil-nvim
plenary-nvim
vim-tmux-navigator
friendly-snippets
vim-ledger
];
};
# not loaded automatically at startup.
# use with packadd and an autocommand in config to achieve lazy loading
optionalPlugins = {
notes = with pkgs.vimPlugins; [
zk-nvim
render-markdown-nvim
];
go = with pkgs.vimPlugins; [
nvim-dap-go
];
lua = with pkgs.vimPlugins; [
lazydev-nvim
];
general = with pkgs.vimPlugins; [
mini-nvim
nvim-lspconfig
blink-cmp
gitsigns-nvim
harpoon2
which-key-nvim
nvim-lint
conform-nvim
nvim-dap
nvim-dap-ui
nvim-dap-virtual-text
];
http = with pkgs.vimPlugins; [
kulala-nvim
];
};
# shared libraries to be added to LD_LIBRARY_PATH
# variable available to nvim runtime
sharedLibraries = {
general = with pkgs; [];
};
# environmentVariables:
# this section is for environmentVariables that should be available
# at RUN TIME for plugins. Will be available to path within neovim terminal
environmentVariables = {
# test = {
# CATTESTVAR = "It worked!";
# };
};
# categories of the function you would have passed to withPackages
python3.libraries = {
# test = [ (_:[]) ];
};
# If you know what these are, you can provide custom ones by category here.
# If you dont, check this link out:
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh
extraWrapperArgs = {
# test = [
# '' --set CATTESTVAR2 "It worked again!"''
# ];
};
};
# see :help nixCats.flake.outputs.packageDefinitions
packageDefinitions.replace = {
# These are the names of your packages
# you can include as many as you wish.
nvim = {
pkgs,
name,
...
}: {
# they contain a settings set defined above
# see :help nixCats.flake.outputs.settings
settings = {
suffix-path = true;
suffix-LD = true;
wrapRc = true;
# unwrappedCfgPath = "/path/to/here";
# IMPORTANT:
# your alias may not conflict with your other packages.
# aliases = [ "vim" "homeVim" ];
# neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim;
hosts.python3.enable = true;
hosts.node.enable = true;
};
# and a set of categories that you want
# (and other information to pass to lua)
# and a set of categories that you want
categories = {
general = true;
notes = true;
lua = true;
nix = true;
go = true;
typescript = true;
yaml = true;
c = true;
csharp = true;
gitlab = true;
http = true;
};
# anything else to pass and grab in lua with `nixCats.extra`
extra = {
nixdExtras.nixpkgs = ''import ${pkgs.path} {}'';
};
};
};
};
};
}