Vagrant.configure("2") do |config|
  config.vm.box = "fedora/39-cloud-base"
  config.vm.network "forwarded_port", guest: 9105, host: 9105

  config.vm.provider "virtualbox" do |vb|
    vb.memory = "1024"
    vb.cpus = 2
  end

  config.vm.provision "shell", inline: <<-SHELL
    dnf install -y sbcl curl git ripgrep sqlite-devel make gcc
    
    # Setup for org-agent
    mkdir -p /home/vagrant/org-agent
    cp -r /vagrant/* /home/vagrant/org-agent/
    chown -R vagrant:vagrant /home/vagrant/org-agent
    
    # Build binary natively
    sudo -u vagrant bash -c "cd /home/vagrant/org-agent && ./deploy/bare-metal/install.sh"
  SHELL
end
