parent
8cd000fb6b
commit
3a687ae95c
19 changed files with 64 additions and 11 deletions
configurations/android
devShells/neovim-shells
homeManagerModules/neovim
default.nix
langs
|
@ -52,7 +52,6 @@
|
|||
user = "nix-on-droid";
|
||||
|
||||
ideConfig = {
|
||||
enableGolang = false;
|
||||
enableJava = false;
|
||||
enableNix = false;
|
||||
};
|
||||
|
|
|
@ -25,6 +25,7 @@ in
|
|||
"kotlin"
|
||||
"lua"
|
||||
"markdown"
|
||||
"golang"
|
||||
"python"
|
||||
"qml"
|
||||
"rust"
|
||||
|
|
|
@ -25,10 +25,6 @@ in {
|
|||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
enableGolang = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
enableJava = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
|
|
@ -15,6 +15,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
|
||||
pattern = { 'cpp', 'c' },
|
||||
|
||||
|
@ -39,6 +40,7 @@ in {
|
|||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local lsp = require('lspconfig');
|
||||
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ in {
|
|||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'RoslynInitialized',
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ in {
|
|||
mkBefore
|
||||
# lua
|
||||
''
|
||||
--
|
||||
-- Init object to keep track of loaded devShells
|
||||
local devShells = {};
|
||||
|
||||
|
@ -93,6 +94,7 @@ in {
|
|||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
require('nvim-autopairs').setup({});
|
||||
'';
|
||||
};
|
||||
|
@ -103,6 +105,7 @@ in {
|
|||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
-- Disable virtual_text since it's redundant due to tiny-inline-diagnostic.
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
|
|
|
@ -1,27 +1,42 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = config.programs.neovim;
|
||||
flakeEnv = config.programs.bash.sessionVariables.FLAKE;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.ideConfig.enableGolang) {
|
||||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = with pkgs; [go gopls];
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local lsp = require('lspconfig');
|
||||
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||
|
||||
lsp.gopls.setup({
|
||||
cmd = { '${pkgs.gopls}/bin/gopls' },
|
||||
capabilities = default_capabilities,
|
||||
autostart = false,
|
||||
});
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
|
||||
pattern = { 'go', 'gomod', 'gowork', 'gotmpl' },
|
||||
|
||||
callback = function()
|
||||
vim.cmd[[setlocal ts=4 sw=4 sts=0 expandtab]];
|
||||
|
||||
if (devShells['golang'] == nil) then
|
||||
devShells['golang'] = 1;
|
||||
|
||||
require('nix-develop').nix_develop_extend({'${flakeEnv}#golang'}, function()
|
||||
vim.cmd[[LspStart]];
|
||||
end);
|
||||
end
|
||||
end,
|
||||
});
|
||||
'';
|
||||
};
|
||||
|
|
12
homeManagerModules/neovim/langs/golang/shell.nix
Normal file
12
homeManagerModules/neovim/langs/golang/shell.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
mkShell,
|
||||
go,
|
||||
gopls,
|
||||
...
|
||||
}:
|
||||
mkShell {
|
||||
packages = [
|
||||
go
|
||||
gopls
|
||||
];
|
||||
}
|
|
@ -13,6 +13,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.filetype.add({
|
||||
pattern = { [ '.*/hypr/.*%.conf' ] = 'hyprlang' },
|
||||
});
|
||||
|
|
|
@ -22,6 +22,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
|
||||
pattern = 'java',
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
|
@ -36,6 +37,7 @@ in {
|
|||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local startJdtls = function()
|
||||
local config = {
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||
|
|
|
@ -14,6 +14,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
|
||||
pattern = { 'json', 'yaml', '.clang-.*' },
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
|
||||
pattern = { 'kotlin' },
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ in {
|
|||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
|
||||
|
|
|
@ -27,6 +27,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
|
||||
pattern = { 'markdown', 'tex' },
|
||||
|
||||
|
@ -69,6 +70,7 @@ in {
|
|||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
require('easytables').setup();
|
||||
'';
|
||||
}
|
||||
|
@ -99,6 +101,7 @@ in {
|
|||
in
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.g.knap_settings = {
|
||||
-- HTML
|
||||
htmloutputext = 'html',
|
||||
|
|
|
@ -74,6 +74,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
require('lspconfig').nixd.setup({
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local lsp = require('lspconfig');
|
||||
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
|
||||
pattern = { 'qml' },
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
|
||||
pattern = { 'rust' },
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ in {
|
|||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local lsp = require('lspconfig');
|
||||
local tsserver = require('typescript-tools');
|
||||
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
|
||||
|
@ -35,7 +36,16 @@ in {
|
|||
end;
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
|
||||
pattern = { 'javascript', 'javascriptreact', 'javascript.jsx', 'typescript', 'typescriptreact', 'typescript.tsx', 'css', 'scss' },
|
||||
pattern = {
|
||||
'javascript',
|
||||
'javascriptreact',
|
||||
'javascript.jsx',
|
||||
'typescript',
|
||||
'typescriptreact',
|
||||
'typescript.tsx',
|
||||
'css',
|
||||
'scss',
|
||||
},
|
||||
|
||||
callback = function()
|
||||
vim.cmd[[setlocal ts=4 sw=4 sts=0 expandtab]];
|
||||
|
@ -185,6 +195,7 @@ in {
|
|||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local packageInfo = require('package-info');
|
||||
|
||||
packageInfo.setup({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue