nixos-configs/homeManagerModules/neovim/langs/csharp.nix

51 lines
1.1 KiB
Nix
Raw Normal View History

2024-12-11 14:00:13 -05:00
self: {
2024-10-05 15:17:16 -04:00
config,
lib,
pkgs,
2024-10-05 15:17:16 -04:00
...
}: let
inherit (lib) mkIf;
2024-12-11 14:00:13 -05:00
inherit (self.inputs) vimplugin-roslyn-nvim-src;
cfg = config.programs.neovim;
2024-12-11 14:00:13 -05:00
in {
config = mkIf cfg.enableIde {
2024-10-05 15:17:16 -04:00
programs = {
neovim = {
extraPackages = builtins.attrValues {
inherit
(pkgs)
2024-12-11 14:00:13 -05:00
roslyn-ls
2024-10-05 15:17:16 -04:00
;
};
extraLuaConfig =
# lua
''
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'cs' },
2024-10-05 15:17:16 -04:00
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
});
2024-12-11 14:00:13 -05:00
require('roslyn').setup({
capabilities = require('cmp_nvim_lsp').default_capabilities(),
2024-12-11 14:00:13 -05:00
exe = 'Microsoft.CodeAnalysis.LanguageServer',
2024-10-05 15:17:16 -04:00
});
'';
2024-12-11 14:00:13 -05:00
plugins = [
(pkgs.vimUtils.buildVimPlugin {
pname = "roslyn-nvim";
version = "0.0.0+${vimplugin-roslyn-nvim-src.shortRev}";
src = vimplugin-roslyn-nvim-src;
})
];
2024-10-05 15:17:16 -04:00
};
};
2024-12-11 14:00:13 -05:00
};
# For accurate stack trace
_file = ./csharp.nix;
}