From 7eb4b1ff5db16429afe06128015ecb96c63b42c5 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Sun, 26 May 2024 16:37:18 +0200 Subject: try to get lsp's to format, general update --- flake.nix | 90 +++++++++++++++++++++++++++++---------------------------------- 1 file changed, 42 insertions(+), 48 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index bca4e90..9b6f797 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = { - "" = "cmp.mapping.confirm({ select = true })"; - "" = { - action = '' - cmp.mapping(function(fallback) + settings = { + autoEnableSources = true; + sources = [ + {name = "nvim_lsp";} + {name = "path";} + {name = "buffer";} + {name = "luasnip";} + ]; + mapping = { + "" = "cmp.mapping.confirm({ select = true })"; + "" = '' + cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item({ behavior = cmp.SelectBehavior.Select -- cgit v1.2.3