refactor(nvim): move packages out of config to devShells
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
0f627107ce
commit
346077c0e0
16 changed files with 144 additions and 107 deletions
|
@ -21,6 +21,7 @@ in {
|
|||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
# We keep the packages here because shell scripts are too common
|
||||
extraPackages = attrValues {
|
||||
inherit
|
||||
(pkgs.nodePackages)
|
||||
|
|
|
@ -4,22 +4,16 @@ self: {
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) attrValues mkIf;
|
||||
inherit (self.lib.${pkgs.system}) buildPlugin;
|
||||
inherit (self.inputs) vimplugin-roslyn-nvim-src;
|
||||
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
roslyn-ls
|
||||
;
|
||||
};
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
|
@ -27,9 +21,18 @@ in {
|
|||
pattern = { 'cs' },
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
{
|
||||
plugin = buildPlugin "roslyn-nvim" vimplugin-roslyn-nvim-src;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'RoslynInitialized',
|
||||
|
||||
callback = function()
|
||||
vim.lsp.inlay_hint.enable();
|
||||
end,
|
||||
|
@ -64,9 +67,7 @@ in {
|
|||
exe = 'Microsoft.CodeAnalysis.LanguageServer',
|
||||
});
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
(buildPlugin "roslyn-nvim" vimplugin-roslyn-nvim-src)
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
12
homeManagerModules/neovim/langs/csharp/shell.nix
Normal file
12
homeManagerModules/neovim/langs/csharp/shell.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
mkShell,
|
||||
dotnetCorePackages,
|
||||
roslyn-ls,
|
||||
...
|
||||
}:
|
||||
mkShell {
|
||||
packages = [
|
||||
dotnetCorePackages.sdk_9_0
|
||||
roslyn-ls
|
||||
];
|
||||
}
|
|
@ -4,29 +4,21 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) attrValues getExe mkIf;
|
||||
inherit (lib) getExe mkIf;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
|
||||
javaSdk = pkgs.temurin-bin-17;
|
||||
javaPkgs = attrValues {inherit (pkgs) gradle maven;};
|
||||
javaSdk = pkgs.temurin-bin-21;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = javaPkgs;
|
||||
|
||||
xdg.dataFile.".gradle/gradle.properties".text = ''
|
||||
org.gradle.java.home = ${javaSdk}
|
||||
'';
|
||||
|
||||
programs = {
|
||||
# We keep the packages here because java is a bit complicated
|
||||
java = {
|
||||
enable = true;
|
||||
package = javaSdk;
|
||||
};
|
||||
|
||||
neovim = {
|
||||
extraPackages = javaPkgs;
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
|
@ -44,7 +36,6 @@ in {
|
|||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local startJdtls = function()
|
||||
local config = {
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||
|
@ -60,7 +51,7 @@ in {
|
|||
configuration = {
|
||||
runtimes = {
|
||||
{
|
||||
name = 'JavaSE-17',
|
||||
name = 'JavaSE-21',
|
||||
path = '${javaSdk}',
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,24 +1,15 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) attrValues mkIf;
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
vscode-langservers-extracted
|
||||
yaml-language-server
|
||||
;
|
||||
};
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
|
|
12
homeManagerModules/neovim/langs/json/shell.nix
Normal file
12
homeManagerModules/neovim/langs/json/shell.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
mkShell,
|
||||
vscode-langservers-extracted,
|
||||
yaml-language-server,
|
||||
...
|
||||
}:
|
||||
mkShell {
|
||||
packages = [
|
||||
vscode-langservers-extracted
|
||||
yaml-language-server
|
||||
];
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) attrValues mkIf;
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
|
||||
|
@ -13,13 +13,6 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
lua-language-server
|
||||
;
|
||||
};
|
||||
|
||||
plugins = [
|
||||
{
|
||||
plugin = pkgs.vimPlugins.neodev-nvim;
|
||||
|
|
10
homeManagerModules/neovim/langs/lua/shell.nix
Normal file
10
homeManagerModules/neovim/langs/lua/shell.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
mkShell,
|
||||
lua-language-server,
|
||||
...
|
||||
}:
|
||||
mkShell {
|
||||
packages = [
|
||||
lua-language-server
|
||||
];
|
||||
}
|
|
@ -9,7 +9,7 @@ self: {
|
|||
inherit (self.inputs) vimplugin-easytables-src;
|
||||
inherit (self.lib.${pkgs.system}) buildPlugin;
|
||||
|
||||
inherit (lib) attrValues concatStringsSep mkIf;
|
||||
inherit (lib) concatStringsSep mkIf;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
isServer = osConfig.roles.server.sshd.enable or false;
|
||||
|
@ -22,16 +22,6 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
pandoc
|
||||
texlab
|
||||
texliveFull
|
||||
rubber
|
||||
;
|
||||
};
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
|
|
16
homeManagerModules/neovim/langs/markdown/shell.nix
Normal file
16
homeManagerModules/neovim/langs/markdown/shell.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
mkShell,
|
||||
pandoc,
|
||||
texlab,
|
||||
texliveFull,
|
||||
rubber,
|
||||
...
|
||||
}:
|
||||
mkShell {
|
||||
packages = [
|
||||
pandoc
|
||||
texlab
|
||||
texliveFull
|
||||
rubber
|
||||
];
|
||||
}
|
|
@ -29,6 +29,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
# We keep the packages here
|
||||
home.packages = attrValues {
|
||||
inherit
|
||||
defaultFormatter
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
cfg = config.programs.neovim;
|
||||
|
||||
# We keep the packages here because python is a bit complicated and common
|
||||
pythonPkgs = py:
|
||||
(attrValues {
|
||||
inherit (py) python-lsp-server;
|
||||
|
|
16
homeManagerModules/neovim/langs/rust/shell.nix
Normal file
16
homeManagerModules/neovim/langs/rust/shell.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
mkShell,
|
||||
cargo,
|
||||
rustc,
|
||||
rust-analyzer,
|
||||
rustfmt,
|
||||
...
|
||||
}:
|
||||
mkShell {
|
||||
packages = [
|
||||
cargo
|
||||
rustc
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
];
|
||||
}
|
|
@ -7,7 +7,7 @@ self: {
|
|||
inherit (self.inputs) vimplugin-ts-error-translator-src;
|
||||
inherit (self.lib.${pkgs.system}) buildPlugin;
|
||||
|
||||
inherit (lib) attrValues mkIf;
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
in {
|
||||
|
@ -16,25 +16,6 @@ in {
|
|||
neovim = {
|
||||
withNodeJs = true;
|
||||
|
||||
extraPackages = attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
neovim-node-client
|
||||
nodejs_latest
|
||||
vscode-langservers-extracted
|
||||
;
|
||||
|
||||
inherit
|
||||
(pkgs.nodePackages)
|
||||
npm
|
||||
;
|
||||
|
||||
inherit
|
||||
(self.packages.${pkgs.system})
|
||||
some-sass-language-server
|
||||
;
|
||||
};
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
|
|
21
homeManagerModules/neovim/langs/web/shell.nix
Normal file
21
homeManagerModules/neovim/langs/web/shell.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
mkShell,
|
||||
neovim-node-client,
|
||||
nodejs_latest,
|
||||
vscode-langservers-extracted,
|
||||
nodePackages,
|
||||
self,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
mkShell {
|
||||
packages = [
|
||||
neovim-node-client
|
||||
nodejs_latest
|
||||
vscode-langservers-extracted
|
||||
|
||||
nodePackages.npm
|
||||
|
||||
self.packages.${system}.some-sass-language-server
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue