diff options
author | tom barrett <tom@tombarrett.xyz> | 2024-05-26 16:37:18 +0200 |
---|---|---|
committer | tom barrett <tom@tombarrett.xyz> | 2024-05-26 16:37:18 +0200 |
commit | 7eb4b1ff5db16429afe06128015ecb96c63b42c5 (patch) | |
tree | a8ad9f8113ca8e8f616f11e7507f677f52e580e1 /flake.nix | |
parent | 69e9543d31c81419ed9a1c5c51c220480289aaa0 (diff) |
try to get lsp's to format, general update
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 90 |
1 files changed, 42 insertions, 48 deletions
@@ -5,9 +5,9 @@ }; outputs = { - self, nixpkgs, nixvim, + self, }: let pkgs = nixpkgs.legacyPackages.x86_64-linux; npkgs = nixvim.legacyPackages.x86_64-linux; @@ -15,67 +15,61 @@ packages.x86_64-linux.default = npkgs.makeNixvimWithModule { module = { config = { + opts = {mouse = "";}; + colorschemes.kanagawa = { + enable = true; + settings.transparent = true; + }; extraPackages = [ - pkgs.alejandra - pkgs.black - pkgs.cargo - pkgs.cmake-format pkgs.go pkgs.rustfmt - pkgs.shfmt - pkgs.yamlfmt ]; - options = {mouse = "";}; - colorschemes.kanagawa = { - enable = true; - transparent = true; - }; plugins = { ledger.enable = true; - lsp = { + lsp-format.enable = true; + vim-css-color.enable = true; + none-ls = { enable = true; - servers = { - bashls.enable = true; - nixd.enable = true; - ruff-lsp.enable = true; - gopls.enable = true; + sources = { + formatting = { + shfmt = { + enable = true; + withArgs = "{ extra_args = {'-i', '4', '-s'}}"; + }; + alejandra.enable = true; + }; }; }; - rustaceanvim.enable = true; - conform-nvim = { + lsp = { enable = true; - formatAfterSave.lspFallback = false; - formattersByFt = { - cmake = ["cmake_format"]; - go = ["gofmt"]; - nix = ["alejandra"]; - python = ["black"]; - rust = ["rustfmt"]; - yaml = ["yamlfmt"]; - _ = ["shfmt"]; - }; - formatters.shfmt = { - prepend_args = ["-i" "4" "-s"]; - }; - formatters.rustfmt = { - prepend_args = ["--edition" "2021"]; + servers = { + cmake.enable = true; + gopls.enable = true; + ruff.enable = true; + nixd.enable = true; + bashls.enable = true; + rust-analyzer = { + enable = true; + installCargo = true; + installRustc = true; + }; }; }; luasnip.enable = true; - nvim-cmp = { + cmp = { enable = true; - snippet.expand = "luasnip"; - autoEnableSources = true; - sources = [ - {name = "nvim_lsp";} - {name = "path";} - {name = "buffer";} - ]; - mapping = { - "<CR>" = "cmp.mapping.confirm({ select = true })"; - "<Tab>" = { - action = '' - cmp.mapping(function(fallback) + settings = { + autoEnableSources = true; + sources = [ + {name = "nvim_lsp";} + {name = "path";} + {name = "buffer";} + {name = "luasnip";} + ]; + mapping = { + "<CR>" = "cmp.mapping.confirm({ select = true })"; + "<Tab>" = '' + cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item({ behavior = cmp.SelectBehavior.Select |