This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / tools / astronvim / flake-module.nix
3.3 kB 109 lines
1{ ... }: 2{ 3 perSystem = 4 { 5 system, 6 lib, 7 pkgs, 8 ... 9 }: 10 let 11 nvim-appname = "lassvim"; 12 13 lsp-packages = 14 with pkgs; 15 [ 16 nodejs # copilot 17 terraform-ls 18 pyright 19 20 # based on ./suggested-pkgs.json 21 gopls 22 golangci-lint 23 nodePackages.bash-language-server 24 taplo-lsp 25 marksman 26 selene 27 rust-analyzer 28 yaml-language-server 29 nil 30 shellcheck 31 shfmt 32 ruff 33 ruff-lsp 34 nixfmt-rfc-style 35 terraform-ls 36 clang-tools 37 nodePackages.prettier 38 stylua 39 # based on https://github.com/ray-x/go.nvim#go-binaries-install-and-update 40 go 41 gofumpt 42 gomodifytags 43 gotools 44 delve 45 golines 46 gomodifytags 47 gotests 48 iferr 49 impl 50 reftools 51 ginkgo 52 richgo 53 govulncheck 54 55 #ocaml-ng.ocamlPackages_5_0.ocaml-lsp 56 #ocaml-ng.ocamlPackages_5_0.ocamlformat 57 # does not build yet on aarch64 58 ] 59 ++ lib.optional (pkgs.stdenv.hostPlatform.system == "x86_64-linux") pkgs.deno 60 ++ lib.optional (!pkgs.stdenv.hostPlatform.isDarwin) sumneko-lua-language-server; 61 62 lspEnv = pkgs.buildEnv { 63 name = "lspEnv"; 64 paths = lsp-packages; 65 }; 66 67 treesitter-grammars = 68 let 69 grammars = lib.filterAttrs ( 70 n: _: lib.hasPrefix "tree-sitter-" n 71 ) pkgs.vimPlugins.nvim-treesitter.builtGrammars; 72 symlinks = lib.mapAttrsToList ( 73 name: grammar: "ln -s ${grammar}/parser $out/${lib.removePrefix "tree-sitter-" name}.so" 74 ) grammars; 75 in 76 (pkgs.runCommand "treesitter-grammars" { } '' 77 mkdir -p $out 78 ${lib.concatStringsSep "\n" symlinks} 79 '').overrideAttrs 80 (_: { 81 passthru.rev = pkgs.vimPlugins.nvim-treesitter.src.rev; 82 }); 83 84 in 85 { 86 packages.vim = pkgs.writeShellScriptBin "vim" '' 87 set -efux 88 unset VIMINIT 89 export PATH=${lspEnv}/bin:$PATH 90 export NVIM_APPNAME=${nvim-appname} 91 92 XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-$HOME/.config} 93 XDG_DATA_HOME=''${XDG_DATA_HOME:-$HOME/.local/share} 94 95 mkdir -p "$XDG_CONFIG_HOME/$NVIM_APPNAME" "$XDG_DATA_HOME" 96 chmod -R u+w "$XDG_CONFIG_HOME/$NVIM_APPNAME" 97 rm -rf "$XDG_CONFIG_HOME/$NVIM_APPNAME" 98 ${pkgs.coreutils}/bin/cp -arfT '${./config}'/ "$XDG_CONFIG_HOME/$NVIM_APPNAME" 99 chmod -R u+w "$XDG_CONFIG_HOME/$NVIM_APPNAME" 100 echo "${treesitter-grammars.rev}" > "$XDG_CONFIG_HOME/$NVIM_APPNAME/treesitter-rev" 101 102 ${pkgs.neovim}/bin/nvim --headless -c 'quitall' # install plugins 103 mkdir -p "$XDG_DATA_HOME/$NVIM_APPNAME/lib/" "$XDG_DATA_HOME/$NVIM_APPNAME/site/" 104 ${pkgs.coreutils}/bin/ln -sfT "${pkgs.vimPlugins.telescope-fzf-native-nvim}/build/libfzf.so" "$XDG_DATA_HOME/$NVIM_APPNAME/lib/libfzf.so" 105 ${pkgs.coreutils}/bin/ln -sfT "${treesitter-grammars}" "$XDG_DATA_HOME/$NVIM_APPNAME/site/parser" 106 exec ${pkgs.neovim}/bin/nvim "$@" 107 ''; 108 }; 109}