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.

45 lines
1.4KB

  1. Vagrant.configure("2") do |config|
  2. config.vm.box = "generic/arch"
  3. config.vm.network "forwarded_port", guest: 3001, host: 8080
  4. config.vm.network "forwarded_port", guest: 5432, host: 54320
  5. config.vm.synced_folder ".", "/home/vagrant/luckybooru"
  6. config.vm.provision "shell", inline: <<-SHELL
  7. pacman -Syu --noconfirm
  8. pacman -S --needed --noconfirm neovim fish base-devel
  9. chsh -s /usr/bin/fish
  10. chsh vagrant -s /usr/bin/fish
  11. pacman -S --needed --noconfirm crystal shards yarn nodejs
  12. SHELL
  13. config.vm.provision "shell", inline: "#!/usr/bin/fish\n" + <<-SHELL
  14. pacman -S --needed --noconfirm postgresql
  15. if not find /var/lib/postgres/data -mindepth 1 | read > /dev/null
  16. su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'"
  17. end
  18. systemctl enable --now postgresql
  19. SHELL
  20. config.vm.provision "shell", privileged: false, inline: "#!/usr/bin/fish\n" + <<-SHELL
  21. function aur_install
  22. git clone https://aur.archlinux.org/$argv; and cd $argv; and makepkg -is --noconfirm --needed; and cd ..; and rm -rf $argv
  23. end
  24. aur_install lucky-git
  25. aur_install overmind-bin
  26. echo 'set -x OVERMIND_SOCKET /home/vagrant/.overmind' > ~/.config/fish/config.fish
  27. SHELL
  28. config.vm.provision "shell", privileged: false, inline: "#!/usr/bin/fish\n" + <<-SHELL
  29. cd luckybooru
  30. ./script/setup
  31. SHELL
  32. end