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.

49 lines
1.5 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. curl -L https://nixos.org/nix/install | sh
  8. if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
  9. . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
  10. fi
  11. }
  12. command -v nix >/dev/null 2>&1 || install_nix_bin
  13. if [ -f "$HOME/.config/nix/installed_packages" ]; then
  14. # This list created with `nix-env -qaPs|grep '^I'|awk '{print $2}' > ~/.config/nix/installed_packages`
  15. cat "$HOME/.config/nix/installed_packages" | xargs nix-env -iA
  16. fi
  17. if [ -f "$HOME/.config/nix/installed_packages.local" ]; then
  18. # Additional packages that might be needed here or there
  19. cat "$HOME/.config/nix/installed_packages.local" | xargs nix-env -i
  20. fi
  21. }
  22. #configure_zsh() {
  23. # # FIXME: We deserve better
  24. # source $HOME/.zshrc
  25. #}
  26. configure_vim() {
  27. # Install vim-plug for Vim
  28. curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
  29. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  30. vim +'PlugInstall --sync' +qa
  31. # Install vim-plug for Neovim
  32. sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
  33. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  34. nvim +'PlugInstall --sync' +qa
  35. }
  36. configure_tmux() {
  37. ~/.tmux/plugins/tpm/bin/install_plugins
  38. }
  39. install_nix
  40. #configure_zsh
  41. configure_vim
  42. configure_tmux