# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "debian/bullseye64"

  config.ssh.forward_x11 = true

  config.vm.provider :virtualbox do |virtualbox|
    config.vm.synced_folder "../", "/src"
  end

  config.vm.provider :libvirt do |libvirt|
    config.vm.synced_folder "../", "/src", type: "nfs", nfs_version: 4.2, nfs_udp: false
  end if Vagrant.has_plugin?('vagrant-libvirt')

  config.vm.provider "virtualbox" do |vb|
    vb.memory = "2048"
    vb.customize [
      "modifyvm", :id,
      "--ioapic", "on",
      "--audio", "alsa",
      "--audiocontroller", "ac97"
    ]
  end
  config.vm.provider "libvirt" do |domain|
    domain.memory = "2048"
#    domain.video_accel3d = true
  end

  config.vm.provision "shell", name: "deps", inline: <<-SHELL
    /src/ci/generic-build-debian.sh
  SHELL
  config.vm.provision "shell",
                      name: "install",
                      inline: "sudo bash -c 'cd /src/build; make install'"
end
