Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b517f96

Browse files
authoredJan 5, 2025··
Merge pull request #27 from gvolpe/nixpkgs/jan-05-2025
flakes: update all inputs on January 5, 2025
2 parents 1d75dd6 + 2fbcd40 commit b517f96

File tree

5 files changed

+362
-267
lines changed

5 files changed

+362
-267
lines changed
 

‎flake.lock‎

Lines changed: 241 additions & 207 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/buildPlugin.nix‎

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@ let
1414
};
1515
};
1616

17-
smithy-lsp = pkgs.callPackage ./smithy-lspconfig.nix { };
18-
19-
smithyLspHook = ''
20-
cat >> $out/lua/lspconfig/server_configurations/smithy.lua <<EOL
21-
${smithy-lsp.lua}
22-
EOL
23-
'';
24-
2517
# sync queries of tree-sitter-scala and nvim-treesitter
2618
queriesHook = ''
27-
cp ${inputs.tree-sitter-scala}/queries/scala/* $out/queries/scala/
19+
cp ${inputs.tree-sitter-scala}/queries/* $out/queries/scala/
2820
cp ${ts.builtGrammars.tree-sitter-smithy}/queries/highlights.scm $out/queries/smithy/highlights.scm
2921
'';
3022

@@ -44,25 +36,38 @@ let
4436
ln -s ${grammars} parser
4537
'';
4638

47-
buildPlug = name: grammars: buildVimPlugin {
48-
pname = name;
49-
version = "master";
50-
src = builtins.getAttr name inputs;
51-
preFixup = ''
52-
${writeIf (name == "nvim-lspconfig") smithyLspHook}
53-
${writeIf (name == "nvim-treesitter") tsPreFixupHook}
54-
${writeIf (name == "telescope-media-files") telescopeFixupHook}
55-
'';
56-
postPatch = ''
57-
${writeIf (name == "nvim-treesitter") (tsPostPatchHook grammars)}
58-
'';
59-
};
39+
plenaryPostPatchHook = ''
40+
sed -Ei lua/plenary/curl.lua \
41+
-e 's@(command\s*=\s*")curl(")@\1${pkgs.curl}/bin/curl\2@'
42+
'';
43+
44+
# following https://github.com/NixOS/nixpkgs/blob/d86ae899d2909c0899e4d3b29d90d5309771e77c/pkgs/applications/editors/vim/plugins/overrides.nix#L139
45+
buildPlug = name: grammars:
46+
let overrides = (final.callPackage ./plugins/overrides.nix { }) { p = name; };
47+
in buildVimPlugin {
48+
inherit name;
49+
inherit (overrides) checkInputs dependencies nvimRequireCheck nvimSkipModule;
50+
51+
version = "master";
52+
src = lib.getAttr name inputs;
53+
54+
doInstallCheck = name == "diffview" || name == "plenary-nvim";
55+
dontBuild = name == "nvim-metals";
56+
57+
preFixup = ''
58+
${writeIf (name == "nvim-treesitter") tsPreFixupHook}
59+
${writeIf (name == "telescope-media-files") telescopeFixupHook}
60+
'';
61+
postPatch = ''
62+
${writeIf (name == "nvim-treesitter") (tsPostPatchHook grammars)}
63+
${writeIf (name == "plenary-nvim") plenaryPostPatchHook}
64+
'';
65+
};
6066

6167
vimPlugins = {
6268
inherit (pkgs.vimPlugins) nerdcommenter;
6369
};
64-
in
65-
rec {
70+
6671
# override at use site with your own preferences
6772
treesitterGrammars = t: t.withPlugins (p: [
6873
p.tree-sitter-scala
@@ -73,6 +78,9 @@ rec {
7378
p.tree-sitter-markdown-inline
7479
p.tree-sitter-smithy
7580
]);
81+
in
82+
{
83+
inherit treesitterGrammars;
7684

7785
neovimPlugins =
7886
let

‎lib/plugins/overrides.nix‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{ curl, neovimPlugins, ... }:
2+
3+
# https://github.com/NixOS/nixpkgs/blob/d86ae899d2909c0899e4d3b29d90d5309771e77c/pkgs/applications/editors/vim/plugins/overrides.nix#L139
4+
let
5+
withDeps = cond: deps: if cond then deps else [ ];
6+
7+
cmpSkip = [
8+
"cmp.matcher_spec"
9+
"cmp.source_spec"
10+
"cmp.types.lsp_spec"
11+
"cmp.context_spec"
12+
"cmp.core_spec"
13+
"cmp.utils.feedkeys_spec"
14+
"cmp.utils.async_spec"
15+
"cmp.utils.misc_spec"
16+
"cmp.utils.api_spec"
17+
"cmp.utils.binary_spec"
18+
"cmp.utils.keymap_spec"
19+
"cmp.utils.str_spec"
20+
"cmp.entry_spec"
21+
];
22+
23+
snackSkip = [
24+
# Requires setup call first
25+
"snacks.dashboard"
26+
"snacks.debug"
27+
"snacks.dim"
28+
"snacks.git"
29+
"snacks.indent"
30+
"snacks.input"
31+
"snacks.lazygit"
32+
"snacks.notifier"
33+
"snacks.scratch"
34+
"snacks.scroll"
35+
"snacks.terminal"
36+
"snacks.win"
37+
"snacks.words"
38+
"snacks.zen"
39+
# Optional trouble integration
40+
"trouble.sources.profiler"
41+
];
42+
in
43+
{ p }: {
44+
checkInputs =
45+
(withDeps (p == "modes-nvim") [ neovimPlugins.nvim-cmp ]) ++
46+
(withDeps (p == "cmp-path") [ neovimPlugins.nvim-cmp ]) ++
47+
(withDeps (p == "cmp-vsnip") [ neovimPlugins.nvim-cmp ]);
48+
49+
dependencies =
50+
(withDeps (p == "diffview") [ neovimPlugins.plenary-nvim ]) ++
51+
(withDeps (p == "harpoon") [ neovimPlugins.plenary-nvim ]) ++
52+
(withDeps (p == "neogit") [ neovimPlugins.plenary-nvim ]) ++
53+
(withDeps (p == "noice") [ neovimPlugins.nui-nvim ]) ++
54+
(withDeps (p == "nvim-metals") [ neovimPlugins.plenary-nvim ]) ++
55+
(withDeps (p == "nvim-treesitter-textobjects") [ neovimPlugins.nvim-treesitter ]) ++
56+
(withDeps (p == "nvim-ufo") [ neovimPlugins.promise-async ]) ++
57+
(withDeps (p == "telescope") [ neovimPlugins.plenary-nvim ]) ++
58+
(withDeps (p == "todo-comments") [ neovimPlugins.plenary-nvim ]);
59+
60+
nvimRequireCheck =
61+
(withDeps (p == "diffview") [ "diffview" ]) ++
62+
(withDeps (p == "harpoon") [ "harpoon" ]) ++
63+
(withDeps (p == "neogit") [ "neogit" ]) ++
64+
(withDeps (p == "noice") [ "noice" ]) ++
65+
(withDeps (p == "nvim-metals") [ "metals" ]) ++
66+
(withDeps (p == "nvim-treesitter") [ "nvim-treesitter" ]) ++
67+
(withDeps (p == "nvim-ufo") [ "ufo" ]) ++
68+
(withDeps (p == "plenary-nvim") [ "plenary" ]) ++
69+
(withDeps (p == "todo-comments") [ "todo-comments" ]);
70+
71+
nvimSkipModule =
72+
(withDeps (p == "indent-blankline") [ "ibl.config.types" ]) ++
73+
(withDeps (p == "nvim-autopairs") [ "nvim-autopairs.completion.cmp" "nvim-autopairs.completion.compe" ]) ++
74+
(withDeps (p == "nvim-bufferline") [ "bufferline.commands" ]) ++
75+
(withDeps (p == "nvim-cmp") cmpSkip) ++
76+
(withDeps (p == "nvim-neoclip") [ "neoclip.fzf" "neoclip.telescope" ]) ++
77+
(withDeps (p == "nvim-notify") [ "notify.integrations.fzf" ]) ++
78+
(withDeps (p == "nvim-treesitter-context") [ "install_parsers" ]) ++
79+
(withDeps (p == "nvim-surround") [ "nvim-surround.queries" ]) ++
80+
(withDeps (p == "onedark") [ "barbecue.theme.onedark" "onedark.highlights" "onedark.colors" "onedark.terminal" ]) ++
81+
(withDeps (p == "snacks") snackSkip) ++
82+
(withDeps (p == "telescope-tabs") [ "search" "search.settings" "search.util" ]) ++
83+
(withDeps (p == "tide") [ "tide.render" "tide.api" "tide.panel" "tide" ]) ++
84+
(withDeps (p == "tokyonight") [ "tokyonight.docs" "tokyonight.extra.fzf" ]) ++
85+
(withDeps (p == "trouble") [ "trouble.docs" ]) ++
86+
(withDeps (p == "which-key") [ "which-key.docs" ]);
87+
}

‎lib/smithy-lspconfig.nix‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

‎modules/lsp/lsp.nix‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ in
476476
-- Smithy config
477477
vim.cmd([[au BufRead,BufNewFile *.smithy setfiletype smithy]])
478478
479-
lspconfig.smithy.setup {
479+
lspconfig.smithy_ls.setup {
480480
capabilities = capabilities;
481481
on_attach = function(client, bufnr)
482482
attach_keymaps(client, bufnr)
@@ -494,7 +494,7 @@ in
494494
495495
${writeIf cfg.ts ''
496496
-- TS config
497-
lspconfig.tsserver.setup {
497+
lspconfig.ts_ls.setup {
498498
capabilities = capabilities;
499499
on_attach = function(client, bufnr)
500500
attach_keymaps(client, bufnr)

0 commit comments

Comments
 (0)
Please sign in to comment.