Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 1 | { pkgs |
| 2 | , system |
| 3 | , lib |
| 4 | , nixpkgs-minion |
| 5 | , home |
| 6 | , utils |
| 7 | , omnisharp-language-server |
| 8 | , ... |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 9 | }: { |
| 10 | programs.neovim = { |
| 11 | coc = { |
| 12 | enable = true; |
| 13 | settings = { |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 14 | diagnostic.floatConfig = { |
| 15 | border = true; |
| 16 | rounded = true; |
| 17 | }; |
| 18 | signature.floatConfig = { |
| 19 | border = true; |
| 20 | rounded = true; |
| 21 | }; |
| 22 | hover.floatConfig = { |
| 23 | border = true; |
| 24 | rounded = true; |
| 25 | }; |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 26 | suggest.floatConfig = { |
| 27 | border = true; |
| 28 | rounded = true; |
| 29 | }; |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 30 | "suggest.noselect" = true; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 31 | "cSpell.checkOnlyEnabledfileTypes" = false; |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 32 | "suggest.virtualText" = true; |
Skyler Grey | 55f8455 | 2022-09-05 11:04:39 +0100 | [diff] [blame] | 33 | "cSpell.dictionaryDefinitions" = [ |
| 34 | { |
| 35 | name = "imperative"; |
| 36 | path = "${home.home.homeDirectory}/.local/share/cspell/dictionary.txt"; |
| 37 | } |
| 38 | ]; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 39 | "cSpell.dictionaries" = [ "imperative" ]; |
Skyler Grey | c52aaae | 2023-04-17 08:14:21 +0000 | [diff] [blame] | 40 | "java.import.gradle.wrapper.enabled" = false; |
Skyler Grey | 55f8455 | 2022-09-05 11:04:39 +0100 | [diff] [blame] | 41 | "git.enableGutters" = false; # We're using another plugin to do this |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 42 | "rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer"; |
Skyler Grey | b2e68e4 | 2023-02-26 13:02:34 +0000 | [diff] [blame] | 43 | "rust-analyzer.lens.enable" = false; |
| 44 | "rust-analyzer.lens.debug.enable" = false; |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 45 | "omnisharp.path" = "${pkgs.omnisharp-roslyn}/bin/OmniSharp"; |
| 46 | "markdownlint.config" = { |
| 47 | line-length = { |
| 48 | code_blocks = false; |
| 49 | tables = false; |
| 50 | }; |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 51 | MD024.siblings_only = true; |
Skyler Grey | e9e4585 | 2022-10-31 00:16:58 +0000 | [diff] [blame] | 52 | MD037 = false; |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 53 | }; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 54 | languageserver = { |
| 55 | nix = { |
| 56 | command = "${pkgs.rnix-lsp}/bin/rnix-lsp"; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 57 | filetypes = [ "nix" ]; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 58 | }; |
Skyler Grey | 1e09822 | 2022-11-05 10:12:12 +0000 | [diff] [blame] | 59 | haskell = { |
| 60 | command = "${pkgs.haskell-language-server}/bin/haskell-language-server-wrapper"; |
| 61 | args = [ "--lsp" ]; |
| 62 | rootPatterns = [ |
| 63 | "*.cabal" |
| 64 | "stack.yaml" |
| 65 | "cabal.project" |
| 66 | "package.yaml" |
| 67 | "hie.yaml" |
| 68 | ]; |
| 69 | filetypes = [ "haskell" "lhaskell" ]; |
| 70 | settings = { |
| 71 | haskell = { |
| 72 | checkParents = "CheckOnSave"; |
| 73 | checkProject = true; |
| 74 | maxCompletions = 40; |
| 75 | formattingProvider = "ormolu"; |
| 76 | plugin = { |
| 77 | stan = { globalOn = true; }; |
| 78 | }; |
| 79 | }; |
| 80 | }; |
| 81 | }; |
Skyler Grey | c52aaae | 2023-04-17 08:14:21 +0000 | [diff] [blame] | 82 | /* ccls = { */ |
| 83 | /* command = "${pkgs.ccls}/bin/ccls"; */ |
| 84 | /* filetypes = [ "c" "cc" "cpp" "c++" "objc" "objcpp" "C" ]; */ |
| 85 | /* rootPatterns = [ ".ccls" "compile_commands.json" ".git/" ".vim/" ]; */ |
| 86 | /* initializationOptions.cache.directory = "/tmp/ccls"; */ |
| 87 | /* }; */ |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 88 | }; |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 89 | "snippets.extends" = { |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 90 | markdown = [ "tex" ]; |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 91 | }; |
| 92 | "snippets.autoTrigger" = false; |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 93 | "codeLens.enable" = true; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 94 | }; |
| 95 | }; |
| 96 | plugins = with pkgs.vimPlugins; [ |
| 97 | # Language servers |
Skyler Grey | c52aaae | 2023-04-17 08:14:21 +0000 | [diff] [blame] | 98 | coc-clangd |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 99 | coc-tsserver |
| 100 | coc-eslint |
| 101 | coc-rust-analyzer |
| 102 | coc-json |
| 103 | coc-jest |
| 104 | coc-css |
Skyler Grey | 140fddc | 2023-01-27 09:43:42 +0000 | [diff] [blame] | 105 | lsp_lines-nvim |
Skyler Grey | 37e3c11 | 2022-09-09 08:15:08 +0100 | [diff] [blame] | 106 | coc-go |
Skyler Grey | b8300e7 | 2022-09-04 23:06:24 +0100 | [diff] [blame] | 107 | coc-markdownlint |
Skyler Grey | 34e5798 | 2022-10-30 23:00:58 +0000 | [diff] [blame] | 108 | coc-texlab |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 109 | coc-pyright |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 110 | coc-java |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 111 | |
| 112 | # Spellchecker |
Skyler Grey | b90fee5 | 2023-02-19 23:47:19 +0000 | [diff] [blame] | 113 | coc-spell-checker |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 114 | nixpkgs-minion.legacyPackages.${system}.vimPlugins.coc-omnisharp |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 115 | |
| 116 | # File explorer |
| 117 | coc-explorer |
| 118 | coc-git # TODO: Check if coc-git is still needed |
| 119 | |
| 120 | # Snippet completion |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 121 | vim-snippets |
Skyler Grey | 81f4af6 | 2022-10-31 00:10:52 +0000 | [diff] [blame] | 122 | coc-snippets |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 123 | ]; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 124 | extraConfig = lib.pipe [ ./keybinds.vim ./theme.vim ] [ |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 125 | (map builtins.readFile) |
| 126 | (builtins.concatStringsSep "\n") |
| 127 | ]; |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 128 | extraPackages = with pkgs; [ |
| 129 | nodejs |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 130 | go |
Skyler Grey | 1e09822 | 2022-11-05 10:12:12 +0000 | [diff] [blame] | 131 | stylish-haskell |
| 132 | haskell-language-server |
| 133 | (haskellPackages.ghcWithPackages (pkgs: with pkgs; [ |
| 134 | dbus |
| 135 | monad-logger |
| 136 | xmonad-contrib |
| 137 | ])) |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 138 | texlab |
| 139 | omnisharp-roslyn |
Skyler Grey | 42ddbfb | 2023-04-06 09:46:36 +0000 | [diff] [blame] | 140 | msbuild |
| 141 | dotnet-sdk |
Skyler Grey | 0c024ef | 2022-10-31 00:17:14 +0000 | [diff] [blame] | 142 | jdt-language-server |
| 143 | jdk |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 144 | nodePackages.pyright |
| 145 | (python3.withPackages (pyPkgs: |
| 146 | with pyPkgs; [ |
| 147 | pycodestyle |
| 148 | black |
| 149 | rope |
| 150 | ])) |
Skyler Grey | fab867f | 2023-01-25 21:45:01 +0000 | [diff] [blame] | 151 | libclang |
| 152 | ccls |
Skyler Grey | f066b51 | 2022-10-31 00:02:48 +0000 | [diff] [blame] | 153 | ]; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 154 | }; |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 155 | home.file = |
| 156 | lib.pipe ./snippets [ |
| 157 | builtins.readDir |
| 158 | builtins.attrNames |
| 159 | (map |
| 160 | (f: { |
| 161 | name = ".config/nvim/UltiSnips/${f}"; |
| 162 | value = { |
| 163 | source = ./snippets + "/${f}"; |
| 164 | target = ".config/nvim/UltiSnips/${f}"; |
| 165 | }; |
| 166 | })) |
| 167 | builtins.listToAttrs |
Skyler Grey | d9c7e1e | 2023-02-26 12:50:27 +0000 | [diff] [blame] | 168 | /* lib.traceValSeq */ |
Skyler Grey | 3d1b450 | 2022-10-31 00:11:11 +0000 | [diff] [blame] | 169 | ] |
| 170 | // { |
| 171 | ".config/coc/placeholder".text = ""; |
| 172 | }; |
Skyler Grey | a7feb6e | 2022-08-26 06:51:55 +0100 | [diff] [blame] | 173 | } |