You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.3 KiB

  1. #!/bin/sh
  2. # vim: set ft=sh sw=2 et :
  3. install_nix() {
  4. # This one courtesy of:
  5. # https://github.com/shadowrylander/shadowrylander/blob/35bb51822c46578d0a5da5810263fa85d464043c/.config/yadm/bootstrap#L56
  6. install_nix_bin() {
  7. # Single User install
  8. # Alternate nix-daemon path: . /nix/var/nix/profiles/per-user/${USER}/profile/etc/profile.d/nix-daemon.sh
  9. # curl -L https://nixos.org/nix/install | sh
  10. #. $HOME/.nix-profile/etc/profile.d/nix.sh
  11. # For Multi-User install
  12. curl -L https://nixos.org/nix/install | sh -s -- --daemon --yes
  13. . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
  14. if [ -f "$HOME/.config/nix/installed_packages" ]; then
  15. # This list created with `nix-env -qaPs|grep '^I'|awk '{print $2}' > ~/.config/nix/installed_packages`
  16. cat "$HOME/.config/nix/installed_packages" | xargs nix-env -iA
  17. fi
  18. }
  19. command -v nix >/dev/null 2>&1 || install_nix_bin
  20. }
  21. configure_vim() {
  22. # Install vim-plug for Vim
  23. #curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  24. #vim +'PlugInstall --sync' +qa
  25. # Install vim-plug for Neovim
  26. # This is temporary disable, because that it hundreds modules and many error on compilation stage of this
  27. curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  28. nvim +'PlugInstall --sync' +qa
  29. }
  30. install_starship() {
  31. # https://starship.rs/guide/#%F0%9F%9A%80-installation
  32. curl -sS https://starship.rs/install.sh | sh -s -- -f
  33. }
  34. install_spacevim() {
  35. # https://habr.com/ru/companies/cloud4y/articles/574450/
  36. curl -sLf https://spacevim.org/install.sh | bash
  37. }
  38. download_font () {
  39. url="https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/SourceCodePro/Regular/complete/${1// /%20}"
  40. path="/usr/share/fonts/$1"
  41. if [[ -f "$path" && ! -s "$path" ]]
  42. then
  43. rm "$path"
  44. fi
  45. if [[ -f "$path" ]]
  46. then
  47. success "Downloaded $1"
  48. else
  49. info "Downloading $1"
  50. curl -s -o "$path" "$url"
  51. success "Downloaded $1"
  52. fi
  53. }
  54. install_fonts () {
  55. download_font "Sauce Code Pro Nerd Font Complete.ttf"
  56. info "Updating font cache, please wait ..."
  57. fc-cache -fv > /dev/null
  58. success "font cache done!"
  59. }
  60. #install_nix
  61. #configure_vim
  62. #install_starship
  63. #install_spacevim