-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhm-module.nix
More file actions
80 lines (69 loc) · 1.55 KB
/
hm-module.nix
File metadata and controls
80 lines (69 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ inputs }:
{ pkgs, config, lib, ... }:
let
# mini.nvim from flake input
mini-nvim = pkgs.vimUtils.buildVimPlugin {
pname = "mini.nvim";
version = "pinned";
src = inputs.mini-nvim-src;
};
# All plugins from imports
allPlugins = import ./plugins.nix { inherit pkgs; };
# Create nv2 wrapper script (like your system's nv command)
# Explicitly loads config file and adds all plugins to runtimepath
nv2 = pkgs.writeShellScriptBin "nv2" ''
srcDir="${config.home.homeDirectory}/.dotfiles/nix_neovim_v2"
exec ${pkgs.neovim}/bin/nvim -u "$srcDir/nvim/init.lua" \
--cmd "set rtp^=$srcDir/nvim" \
${builtins.concatStringsSep " " (map (p: "--cmd \"set rtp+=${p}\"") ([mini-nvim] ++ allPlugins))} \
"$@"
'';
in
{
programs.neovim = {
enable = true;
vimAlias = true;
viAlias = true;
plugins = [ mini-nvim ] ++ allPlugins;
};
xdg.configFile."nvim" = {
source = ./nvim;
recursive = true;
};
home.packages = with pkgs; [
# nv2 command alias
nv2
# CLI tools
ripgrep
fd
# LSP servers
lua-language-server
nil
bash-language-server
pyright
rust-analyzer
clangd
gopls
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
# Formatters
stylua
alejandra
ruff
prettierd
goimports
gofmt
clang-tools
# Linters
shellcheck
statix
jsonlint
yamllint
selene
golangci-lint
# DAP adapters
python3.pkgs.debugpy
# Optional
nodePackages.markdownlint-cli2
];
}