nix-community / nixbox

NixOS Vagrant boxes [maintainer=@ifurther]
https://app.vagrantup.com/nixbox/
MIT License
309 stars 101 forks source link

fix sha256 extraction in iso_urls_update.rb and new qemu builder feature #35

Closed cdituri closed 5 years ago

cdituri commented 5 years ago

I've been working with nixos a lot and the nixbox is great for quickly getting started! Sending my thanks out to all contributors.

Noticed there was no qemu-kvm support/vagrant_boxes however (my preference) so decided to add it as an optional builder and contribute back.

Thus, this PR provides the following:

  1. 062736b - fix the sha256 field extraction in iso_urls_update.rb

  2. cda5b49 - code cleanup

  3. 54cedc8 - add support for qemu packer builder. Current make behavior is maintained; one must opt-in to using the qemu builder.

Usages as follows:

make # default behavior; use virtualbox-iso builder, vagrant post-processor
make BUILDERS=qemu # use qemu builder, vagrant post-processor
make BUILDERS=virtualbox-iso,qemu # multiple builder support; use virtualbox-iso and qemu builders, plus vagrant post-processor
  1. 095b77e - bumps iso_urls.json to today's current release version and updates the nixos-{i686,x86_64}.json packer templates with optional qemu support
cdituri commented 5 years ago

Just noticed [maintainer = @zimbatm] in the repo description, so tagging you here! thanks.

cdituri commented 5 years ago
Two bits worth noting regarding the resultant qemu vagrant boxes.
  1. Default vagrant synced folder protocol for the libvirt qemu provider is rsync; however this mechanism is uni-directional, host => guest only. For bi-directional support, consider using 9p protocol; see minimal Vagrantfile below.

  2. I can confirm that the libvirt.nested = true option works as expected- which is interesting, at least to me, from a nixos-build build-vm perspective :-)


Minimal qemu Vagrantfile with 9p bi-directional synced folder and nested virtualization enabled
Vagrant.configure("2") do |config|
  config.vm.box = "nixbox64"

  config.vm.synced_folder './', '/vagrant', type: '9p', disabled: false, accessmode: "squash", owner: "1000"

  config.vm.provider "libvirt" do |libvirt|
    libvirt.cpus = 1
    libvirt.memory = 2048
    libvirt.nested = true
  end
end
zimbatm commented 5 years ago

really cool, thanks!

do you mind also extending the README usage a bit? Other than that it looks ready to go.

cdituri commented 5 years ago

do you mind also extending the README usage a bit? Other than that it looks ready to go.

No problem @zimbatm - I've updated the README in d729e86

zimbatm commented 5 years ago

thanks!