-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
175 lines (148 loc) · 4.83 KB
/
flake.nix
File metadata and controls
175 lines (148 loc) · 4.83 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{
description = "Kenneth's Neovim Configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Neovim with custom configuration
neovimConfig = pkgs.neovim.override {
configure = {
customRC = ''
" Set the runtime path to include this configuration
set runtimepath^=${self}
set runtimepath+=${self}/after
" Source the main init.lua
lua dofile("${self}/init.lua")
'';
packages.myVimPackage = with pkgs.vimPlugins; {
# Essential plugins that should be available immediately
start = [
# Plugin manager
lazy-nvim
# Core dependencies
plenary-nvim
nvim-web-devicons
# LSP and completion
nvim-lspconfig
nvim-cmp
cmp-nvim-lsp
cmp-buffer
cmp-path
cmp-cmdline
luasnip
cmp_luasnip
# Treesitter
nvim-treesitter.withAllGrammars
nvim-treesitter-textobjects
# Telescope
telescope-nvim
telescope-fzf-native-nvim
# Git
fugitive
gitsigns-nvim
# UI
lualine-nvim
nvim-notify
which-key-nvim
# Navigation
harpoon
nvim-tree-lua
# Utilities
comment-nvim
nvim-autopairs
indent-blankline-nvim
# Themes
kanagawa-nvim
gruvbox-nvim
# Additional useful plugins
undotree
vim-sleuth
nvim-surround
];
# Optional plugins that can be lazy-loaded
opt = [ ];
};
};
};
# Development tools that complement the Neovim setup
devTools = with pkgs; [
# Language servers (matching your LSP config)
lua-language-server
rust-analyzer
nil # Nix LSP
nixd # Alternative Nix LSP
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
pyright
# Formatters
stylua
nixpkgs-fmt
rustfmt
nodePackages.prettier
black
# Linters
selene # Lua linter
# Tools
ripgrep
fd
fzf
git
lazygit
tree-sitter
# Build tools
gcc
cmake
gnumake
pkg-config
];
in
{
# Main package: Neovim with your configuration
packages = {
default = neovimConfig;
neovim = neovimConfig;
# Alternative: just the config files
config = pkgs.stdenv.mkDerivation {
name = "neovim-config";
src = ./.;
installPhase = ''
mkdir -p $out
cp -r * $out/
'';
};
};
# Development shell with all tools
devShells.default = pkgs.mkShell {
buildInputs = [ neovimConfig ] ++ devTools;
shellHook = ''
echo "Kenneth's Neovim development environment loaded!"
echo "Neovim with custom config available as 'nvim'"
echo ""
echo "Available tools:"
echo " - Language servers: lua-language-server, rust-analyzer, nil, nixd, etc."
echo " - Formatters: stylua, nixpkgs-fmt, rustfmt, prettier, black"
echo " - Utilities: ripgrep, fd, fzf, lazygit"
echo ""
echo "To use this config on NixOS, add to your configuration:"
echo " environment.systemPackages = [ inputs.neovim-config.packages.\''${system}.default ];"
'';
};
# Apps for easy running
apps = {
default = {
type = "app";
program = "${neovimConfig}/bin/nvim";
};
neovim = {
type = "app";
program = "${neovimConfig}/bin/nvim";
};
};
# Formatter for this flake
formatter = pkgs.nixpkgs-fmt;
});
}