45 lines
1.4 KiB
Ruby
45 lines
1.4 KiB
Ruby
Vagrant.configure("2") do |config|
|
|
config.vm.box = "generic/arch"
|
|
|
|
config.vm.network "forwarded_port", guest: 3001, host: 8080
|
|
config.vm.network "forwarded_port", guest: 5432, host: 54320
|
|
|
|
config.vm.synced_folder ".", "/home/vagrant/luckybooru"
|
|
|
|
config.vm.provision "shell", inline: <<-SHELL
|
|
pacman -Syu --noconfirm
|
|
|
|
pacman -S --needed --noconfirm neovim fish base-devel
|
|
chsh -s /usr/bin/fish
|
|
chsh vagrant -s /usr/bin/fish
|
|
|
|
pacman -S --needed --noconfirm crystal shards yarn nodejs
|
|
SHELL
|
|
|
|
config.vm.provision "shell", inline: "#!/usr/bin/fish\n" + <<-SHELL
|
|
pacman -S --needed --noconfirm postgresql
|
|
|
|
if not find /var/lib/postgres/data -mindepth 1 | read > /dev/null
|
|
su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'"
|
|
end
|
|
|
|
systemctl enable --now postgresql
|
|
SHELL
|
|
|
|
config.vm.provision "shell", privileged: false, inline: "#!/usr/bin/fish\n" + <<-SHELL
|
|
function aur_install
|
|
git clone https://aur.archlinux.org/$argv; and cd $argv; and makepkg -is --noconfirm --needed; and cd ..; and rm -rf $argv
|
|
end
|
|
|
|
aur_install lucky-git
|
|
aur_install overmind-bin
|
|
|
|
echo 'set -x OVERMIND_SOCKET /home/vagrant/.overmind' > ~/.config/fish/config.fish
|
|
SHELL
|
|
|
|
config.vm.provision "shell", privileged: false, inline: "#!/usr/bin/fish\n" + <<-SHELL
|
|
cd luckybooru
|
|
./script/setup
|
|
SHELL
|
|
end
|