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