171 lines
4.2 KiB
Nix
171 lines
4.2 KiB
Nix
{ config, ... }:
|
|
let
|
|
repoTheme = config.repo.theme.kanagawa;
|
|
in
|
|
{
|
|
flake.modules.homeManager.neovim =
|
|
{
|
|
pkgs,
|
|
config,
|
|
inputs,
|
|
...
|
|
}:
|
|
{
|
|
home.sessionVariables = {
|
|
EDITOR = "nvim";
|
|
VISUAL = "nvim";
|
|
};
|
|
|
|
imports = [
|
|
(inputs.nix-wrapper-modules.lib.mkInstallModule {
|
|
name = "neovim";
|
|
value = inputs.nix-wrapper-modules.lib.wrapperModules.neovim;
|
|
loc = [
|
|
"home"
|
|
"packages"
|
|
];
|
|
})
|
|
];
|
|
|
|
wrappers.neovim = {
|
|
enable = true;
|
|
|
|
# 1. Point to your existing Lua config directory
|
|
settings.config_directory = ./lua-config;
|
|
|
|
# 2. Runtime Dependencies (from lspsAndRuntimeDeps)
|
|
# These are added to the PATH of the wrapper
|
|
extraPackages = with pkgs; [
|
|
# Tools
|
|
universal-ctags
|
|
ripgrep
|
|
fd
|
|
tree-sitter
|
|
wl-clipboard
|
|
# LSPs & Formatters
|
|
stylua
|
|
lua-language-server
|
|
nixd
|
|
nix-doc
|
|
nixfmt
|
|
dafny
|
|
typescript
|
|
typescript-language-server
|
|
rustc
|
|
rust-analyzer
|
|
rustfmt
|
|
astro-language-server
|
|
tinymist
|
|
typstyle
|
|
websocat
|
|
|
|
# ty
|
|
# basedpyright
|
|
ty
|
|
ruff
|
|
];
|
|
|
|
# 3. Plugins
|
|
# Nix provisions plugins; lz.n controls when lazy specs are packadd'd.
|
|
specs = {
|
|
lz-n = {
|
|
data = pkgs.vimPlugins.lz-n;
|
|
};
|
|
|
|
support = {
|
|
data = with pkgs.vimPlugins; [
|
|
plenary-nvim
|
|
kanagawa-nvim
|
|
nvim-treesitter.withAllGrammars
|
|
nvim-treesitter-textobjects
|
|
telescope-nvim
|
|
telescope-fzf-native-nvim
|
|
telescope-ui-select-nvim
|
|
];
|
|
};
|
|
|
|
completion = {
|
|
lazy = true;
|
|
data = with pkgs.vimPlugins; [
|
|
blink-cmp
|
|
luasnip
|
|
friendly-snippets
|
|
colorful-menu-nvim
|
|
];
|
|
};
|
|
|
|
lsp = {
|
|
lazy = true;
|
|
data = with pkgs.vimPlugins; [
|
|
nvim-lspconfig
|
|
lazydev-nvim
|
|
trouble-nvim
|
|
typst-preview-nvim
|
|
];
|
|
};
|
|
|
|
formatting = {
|
|
lazy = true;
|
|
data = with pkgs.vimPlugins; [
|
|
conform-nvim
|
|
];
|
|
};
|
|
|
|
core = {
|
|
lazy = true;
|
|
data = with pkgs.vimPlugins; [
|
|
mini-nvim
|
|
guess-indent-nvim
|
|
direnv-vim
|
|
];
|
|
};
|
|
|
|
ui = {
|
|
lazy = true;
|
|
data = with pkgs.vimPlugins; [
|
|
lualine-nvim
|
|
zen-mode-nvim
|
|
which-key-nvim
|
|
];
|
|
};
|
|
|
|
project = {
|
|
lazy = true;
|
|
data = with pkgs.vimPlugins; [
|
|
project-nvim
|
|
];
|
|
};
|
|
};
|
|
|
|
# 4. Passing Data to Lua (Replacing nixCats.extra)
|
|
# We put these in `settings` so they appear in require('nix-info').settings
|
|
settings = {
|
|
# Hostname/ConfigDir needed for nixd
|
|
nixdExtras = {
|
|
nixpkgs = "import ${pkgs.path} {}";
|
|
nixos_options = ''(builtins.getFlake "path://${config.meta.user.account.nixosConfigurationPath}").nixosConfigurations.${config.meta.machine.name}.options'';
|
|
home_manager_options = ''(builtins.getFlake "path://${config.meta.user.account.nixosConfigurationPath}").nixosConfigurations.${config.meta.machine.name}.options.home-manager.users.type.getSubOptions []'';
|
|
};
|
|
|
|
themeSetup = import ./_kanagawa-theme.nix {
|
|
themeName = repoTheme.name;
|
|
};
|
|
|
|
typstPreviewDependencies = {
|
|
tinymist = "${pkgs.tinymist}/bin/tinymist";
|
|
websocat = "${pkgs.websocat}/bin/websocat";
|
|
};
|
|
|
|
};
|
|
|
|
# 5. Wrapper Configuration
|
|
# Enable Python/Node providers
|
|
hosts.python3.nvim-host.enable = true;
|
|
hosts.node.nvim-host.enable = true;
|
|
|
|
# Ensure the bin name matches what you expect
|
|
binName = "nvim";
|
|
};
|
|
};
|
|
}
|