update.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/usr/bin/env bash
  2. add_plugin() {
  3. owner=$1
  4. repo=$2
  5. branch=${3:-HEAD}
  6. dont_build=${4:-true}
  7. echo "Updating $owner/$repo" >&2
  8. revision=$(git ls-remote "https://github.com/$owner/$repo" "$branch" | cut -b -40)
  9. sha256=$(nix-prefetch-url --unpack "https://github.com/$owner/$repo/archive/$revision.tar.gz")
  10. cat <<EOF
  11. (stdenv.mkDerivation {
  12. name = "$repo";
  13. src = fetchFromGitHub {
  14. owner = "$owner";
  15. repo = "$repo";
  16. rev = "$revision";
  17. sha256 = "$sha256";
  18. };
  19. dontBuild = $dont_build;
  20. installPhase = ''
  21. cp -r . \$out
  22. '';
  23. })
  24. EOF
  25. }
  26. echo "{ stdenv, fetchFromGitHub }:
  27. ["
  28. add_plugin tpope vim-sensible
  29. add_plugin tpope vim-sleuth
  30. add_plugin tpope vim-fugitive
  31. add_plugin tpope vim-rhubarb
  32. add_plugin tpope vim-surround
  33. add_plugin tpope vim-abolish
  34. add_plugin mbbill undotree
  35. add_plugin nvim-telescope telescope.nvim
  36. add_plugin nvim-telescope telescope-fzf-native.nvim HEAD false
  37. add_plugin nvim-lua plenary.nvim
  38. add_plugin echasnovski mini.nvim
  39. add_plugin lewis6991 gitsigns.nvim
  40. add_plugin neovim nvim-lspconfig
  41. add_plugin nvim-treesitter nvim-treesitter-textobjects
  42. add_plugin jose-elias-alvarez typescript.nvim
  43. add_plugin jose-elias-alvarez null-ls.nvim
  44. add_plugin j-hui fidget.nvim
  45. add_plugin sainnhe sonokai
  46. echo "]"