parent
0a90a3f619
commit
73a8bc507f
5 changed files with 71 additions and 17 deletions
devShells/neovim-shells
homeManagerModules/neovim/langs
|
@ -19,11 +19,12 @@
|
||||||
langs);
|
langs);
|
||||||
in
|
in
|
||||||
mkLangsShells [
|
mkLangsShells [
|
||||||
|
"c-lang"
|
||||||
"csharp"
|
"csharp"
|
||||||
"json"
|
"json"
|
||||||
"lua"
|
"lua"
|
||||||
"markdown"
|
"markdown"
|
||||||
|
"qml"
|
||||||
"rust"
|
"rust"
|
||||||
"web"
|
"web"
|
||||||
"c-lang"
|
|
||||||
]
|
]
|
||||||
|
|
|
@ -20,6 +20,7 @@ in {
|
||||||
./json
|
./json
|
||||||
./lua
|
./lua
|
||||||
./python
|
./python
|
||||||
|
./qml
|
||||||
./rust
|
./rust
|
||||||
|
|
||||||
(import ./csharp self)
|
(import ./csharp self)
|
||||||
|
|
|
@ -13,23 +13,17 @@ in {
|
||||||
neovim = {
|
neovim = {
|
||||||
extraPackages = with pkgs; [go gopls];
|
extraPackages = with pkgs; [go gopls];
|
||||||
|
|
||||||
plugins = [
|
extraLuaConfig =
|
||||||
{
|
# lua
|
||||||
plugin = pkgs.vimPlugins.clangd_extensions-nvim;
|
''
|
||||||
type = "lua";
|
local lsp = require('lspconfig');
|
||||||
config =
|
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||||
# lua
|
|
||||||
''
|
|
||||||
local lsp = require('lspconfig');
|
|
||||||
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
|
||||||
|
|
||||||
lsp.gopls.setup({
|
lsp.gopls.setup({
|
||||||
cmd = { '${pkgs.gopls}/bin/gopls' },
|
cmd = { '${pkgs.gopls}/bin/gopls' },
|
||||||
capabilities = default_capabilities,
|
capabilities = default_capabilities,
|
||||||
});
|
});
|
||||||
'';
|
'';
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
48
homeManagerModules/neovim/langs/qml/default.nix
Normal file
48
homeManagerModules/neovim/langs/qml/default.nix
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
|
||||||
|
cfg = config.programs.neovim;
|
||||||
|
flakeEnv = config.programs.bash.sessionVariables.FLAKE;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs = {
|
||||||
|
neovim = {
|
||||||
|
extraLuaConfig =
|
||||||
|
# lua
|
||||||
|
''
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = { 'qml' },
|
||||||
|
|
||||||
|
callback = function()
|
||||||
|
vim.cmd[[setlocal ts=4 sw=4 sts=0 expandtab]];
|
||||||
|
|
||||||
|
if (devShells['qml'] == nil) then
|
||||||
|
devShells['qml'] = 1;
|
||||||
|
|
||||||
|
require('nix-develop').nix_develop_extend({'${flakeEnv}#qml'}, function()
|
||||||
|
vim.cmd[[LspStart]];
|
||||||
|
end);
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
});
|
||||||
|
|
||||||
|
local lsp = require('lspconfig');
|
||||||
|
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||||
|
|
||||||
|
lsp.qmlls.setup({
|
||||||
|
cmd = { 'qmlls', '-E' },
|
||||||
|
capabilities = default_capabilities,
|
||||||
|
autostart = false,
|
||||||
|
});
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# For accurate stack trace
|
||||||
|
_file = ./default.nix;
|
||||||
|
}
|
10
homeManagerModules/neovim/langs/qml/shell.nix
Normal file
10
homeManagerModules/neovim/langs/qml/shell.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
mkShell,
|
||||||
|
kdePackages,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
mkShell {
|
||||||
|
packages = [
|
||||||
|
kdePackages.qtdeclarative
|
||||||
|
];
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue