forked from Gerschtli/nix-config
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nixpkgs.nix
250 lines (219 loc) · 9.7 KB
/
nixpkgs.nix
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
{ inputs, rootPath, system, nixOnDroid ? false, }:
let
config = {
allowAliases = false;
allowUnfree = true;
};
in import inputs.nixpkgs {
inherit config system rootPath;
overlays = [
(final: prev:
let
inherit (prev.stdenv.hostPlatform) system;
inherit rootPath;
unstable = import inputs.unstable { inherit config system; };
# master = import inputs.master { inherit config system; };
# staging = import inputs.staging { inherit config system; };
moreOverlays = [
inputs.rust-overlay.overlays.default
# dont use see https://github.com/nix-community/neovim-nightly-overlay/issues/153#issuecomment-1264366764
#inputs.neovim-nightly-overlay.overlay # What I try to achieve here is to have neovim as overridden in the overlay below be the neovim neovim-nightly-overlay provides !??
#inputs.neovim-flake.overlay
inputs.emacs-overlay.overlays.default
];
in {
inherit (unstable)
alejandra nil rnix-lsp manix lolcat fd deadnix statix nixfmt
sumneko-lua-language-server texlab
##deno # long rebuild needed in unstable so taking release-version
stylua nnn
##sqlite # long rebuild needed in unstable so taking release-version
nodejs_latest # long rebuild needed in unstable so taking release-version
yarn # long rebuild needed in unstable so taking release-version
#broot
chafa ripgrep
##w3m # long rebuild needed in unstable so taking release-version, see i. e. nix why-depends --derivation nixos-unstable#w3m nixos-unstable#fontforge
##fff # long rebuild needed in unstable so taking release-version, see i. e. nix why-depends --derivation nixos-unstable#w3m nixos-unstable#fontforge
epr vale ltex-ls
# TODO https://github.com/rocktimsaikia/cambd-cli
;
nodePackages = prev.nodePackages // {
inherit (unstable.nodePackages)
bash-language-server vim-language-server typescript
typescript-language-server vscode-json-languageserver-bin
yaml-language-server;
};
vimPlugins = prev.vimPlugins // {
inherit (unstable.vimPlugins)
cmp-cmdline null-ls-nvim plenary-nvim nvim-lspconfig trouble-nvim
nvim-cmp cmp-buffer cmp-path cmp_luasnip cmp-nvim-lsp cmp-omni
cmp-emoji cmp-nvim-lua luasnip friendly-snippets lspkind-nvim
# LanguageTool-nvim
vim-grammarous comment-nvim nvim-treesitter nvim-treesitter-context
indent-blankline-nvim wildfire-vim nvim-tree-lua nnn-vim
asyncrun-vim vim-table-mode telescope-nvim zen-mode-nvim;
};
builtGrammars = prev.tree-sitter.builtGrammars // {
inherit (unstable.tree-sitter.builtGrammars)
tree-sitter-lua tree-sitter-python tree-sitter-nix tree-sitter-ruby
tree-sitter-vim tree-sitter-json tree-sitter-bash
tree-sitter-comment tree-sitter-latex;
};
telescope-makefile = prev.vimUtils.buildVimPlugin {
name = "telescope-makefile";
src = inputs.telescope-makefile;
};
markid = prev.vimUtils.buildVimPlugin {
name = "markid";
src = inputs.markid;
};
virtual-types-nvim = prev.vimUtils.buildVimPlugin {
name = "virtual-types.nvim";
src = inputs.virtual-types-nvim;
};
code-runner-nvim = prev.vimUtils.buildVimPlugin {
name = "code_runner.nvim";
src = inputs.code-runner-nvim;
};
nvim-osc52 = prev.vimUtils.buildVimPlugin {
name = "nvim-osc52";
src = inputs.nvim-osc52;
};
haskell-tools-nvim = prev.vimUtils.buildVimPlugin {
name = "haskell-tools.nvim";
src = inputs.haskell-tools-nvim;
};
fsread-nvim = prev.vimUtils.buildVimPlugin {
name = "fsread.nvim";
src = inputs.fsread-nvim;
};
nvim-treesitter-full-uns =
unstable.vimPlugins.nvim-treesitter.withPlugins
(_: unstable.tree-sitter.allGrammars);
nvim-treesitter-full = (final.vimPlugins.nvim-treesitter.withPlugins
(_: final.tree-sitter.allGrammars)).overrideAttrs
(_: { src = inputs.nvim-treesitter; });
nvim-treesitter-selection =
(final.vimPlugins.nvim-treesitter.withPlugins (_:
with final.tree-sitter.builtGrammars; [
tree-sitter-lua
tree-sitter-python
tree-sitter-nix
tree-sitter-ruby
tree-sitter-vim
tree-sitter-json
tree-sitter-bash
tree-sitter-comment
tree-sitter-latex
])).overrideAttrs (_: { src = inputs.nvim-treesitter; });
ghcWithHoogle = final.haskellPackages.ghcWithHoogle (haskellPackages:
with haskellPackages; [
# libraries
arrows
async
cgi
criterion
# tools
cabal-install
haskintex
haskell-language-server
]);
# inherit (inputs.neovim-nightly-overlay.packages.${pkgs.stdenv.hostPlatform.system}) neovim; # see staging PR note
somemore = prev.lib.composeManyExtensions moreOverlays final prev;
neovim = unstable.neovim.override {
# final.neovim-nightly.override { # error: attribute 'neovim-nightly' missing # final, weil das overlay bereits applied wurde # inputs.neovim-nightly-overlay.packages.${prev.stdenv.hostPlatform.system}.neovim.override { # error: anonymous function at /nix/store/yz0w1s863vqsas7jpzg5rpc29ig17566-source/pkgs/applications/editors/neovim/default.nix:1:1 called with unexpected argument 'viAlias' # inputs.neovim-flake.packages.${prev.stdenv.hostPlatform.system}.neovim.override { # I wonder why final.neovim-nightly doesn't work here or eveb final.neovim when the overlay is applied already above
viAlias = true;
vimAlias = true;
# vimdiffAlias = true; # for this needs to override wrapNeovimUnstable in overlay (https://github.com/NixOS/nixpkgs/pull/121339#issuecomment-830868690)
configure = {
packages.plugins = {
start = (with final.vimPlugins; [
# https://gitlab.com/rycee/home-manager/blob/de3758e3/modules/programs/neovim.nix#L113
null-ls-nvim
plenary-nvim
nvim-lspconfig
trouble-nvim
nvim-cmp
cmp-cmdline
cmp-buffer
cmp-path
cmp_luasnip
cmp-nvim-lsp
cmp-omni
cmp-emoji
cmp-nvim-lua
luasnip
friendly-snippets
lspkind-nvim
# LanguageTool-nvim
vim-grammarous
comment-nvim
nvim-treesitter-context
indent-blankline-nvim
wildfire-vim
nvim-tree-lua
nnn-vim
asyncrun-vim
vim-table-mode
telescope-nvim
zen-mode-nvim
final.nvim-treesitter-full-uns
#pkgs.nvim-treesitter-selection
]) ++ (with final; [
markid
nvim-osc52
telescope-makefile
code-runner-nvim
virtual-types-nvim
haskell-tools-nvim
fsread-nvim
]);
};
customRC = ''
if filereadable($HOME . "/.vimrc")
source ~/.vimrc
endif
luafile ${rootPath}/home/misc/nvim-treesitter.lua
luafile ${rootPath}/home/misc/trouble-nvim.lua
luafile ${rootPath}/home/misc/null-ls-nvim.lua
luafile ${rootPath}/home/misc/nvim-lspconfig.lua
luafile ${rootPath}/home/misc/nvim-cmp.lua
luafile ${rootPath}/home/misc/luasnip-snippets.lua
luafile ${rootPath}/home/misc/comment-nvim.lua
luafile ${rootPath}/home/misc/indent-blankline.lua
luafile ${rootPath}/home/misc/markid.lua
luafile ${rootPath}/home/misc/nvim-treesitter-context.lua
luafile ${rootPath}/home/misc/nvim-osc52.lua
luafile ${rootPath}/home/misc/telescope-nvim.lua
" let g:languagetool_server_command='$ { pkgs.languagetool }/bin/languagetool-http-server'
'';
};
};
#inherit (inputs) sanemacs;
# see https://sourcegraph.com/github.com/johnae/world@016fbbb0d64af7fc3963e2253e6dffada8d26cb5/-/blob/packages/overlays.nix?L78
# better: https://sourcegraph.com/search?q=context:global+content:%22emacsWithPackagesFromUsePackage%22+file:%5E.*%5C.nix%24&patternType=standard&sm=1
my-emacs = let my-emacs-el = "${rootPath}/home/misc/emacs.el";
in final.somemore.emacsWithPackagesFromUsePackage {
package = final.somemore.emacsUnstable-nox;
config = builtins.readFile my-emacs-el;
alwaysEnsure = true;
override = epkgs: epkgs // {
my-default-el = final.runCommand "default.el" {} ''
mkdir -p $out/share/emacs/site-lisp
cp -r ${my-emacs-el} $out/share/emacs/site-lisp/default.el
'';
};
extraEmacsPackages = epkgs: with epkgs; [
my-default-el
use-package
moe-theme
];
};
# the only alias that I need, this allows me to set allowAliases=false
inherit system rootPath;
inherit (prev.nixVersions) nix_2_4; # for nix-on-droid
})
#inputs.nixGL.overlays.default
] ++ inputs.nixpkgs.lib.optional nixOnDroid
inputs.nix-on-droid.overlays.default;
}