refactor: restructure config files
This commit is contained in:
@@ -0,0 +1,181 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
repoTheme = config.repo.theme.kanagawa;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.neovim =
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
inputs,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
{
|
||||
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
|
||||
rainbow-delimiters-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
|
||||
bufferline-nvim
|
||||
gitsigns-nvim
|
||||
zen-mode-nvim
|
||||
which-key-nvim
|
||||
kulala-nvim
|
||||
];
|
||||
};
|
||||
|
||||
project = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
project-nvim
|
||||
];
|
||||
};
|
||||
|
||||
telescope = {
|
||||
lazy = true;
|
||||
data = with pkgs.vimPlugins; [
|
||||
telescope-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-ui-select-nvim
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# 4. Values exposed to Lua through require("nix-info").settings.
|
||||
settings = {
|
||||
# Hostname/ConfigDir needed for nixd
|
||||
nixdExtras = {
|
||||
nixpkgs = "import ${pkgs.path} {}";
|
||||
nixos_options = ''(builtins.getFlake "path://${account.nixosConfigurationPath}").nixosConfigurations.${osConfig.meta.machine.name}.options'';
|
||||
home_manager_options = ''(builtins.getFlake "path://${account.nixosConfigurationPath}").nixosConfigurations.${osConfig.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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user