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