18 documentation.man.enable = false;
19 documentation.nixos.enable = false;
21 users.extraUsers.vagrant.extraGroups = [ "vboxsf" ];
23 # generate the box v1 format which is much easier to generate
24 # https://www.vagrantup.com/docs/boxes/format.html
25 system.build.vagrantVirtualbox = pkgs.runCommand
26 "virtualbox-vagrant.box"
32 # 1. create that metadata.json file
33 echo '{"provider":"virtualbox"}' > metadata.json
35 # 2. create a default Vagrantfile config
36 cat <<VAGRANTFILE > Vagrantfile
37 Vagrant.configure("2") do |config|
38 config.vm.base_mac = "0800275F0936"
42 # 3. add the exported VM files
43 tar xvf ${config.system.build.virtualBoxOVA}/*.ova
45 # 4. move the ovf to the fixed location
48 # 5. generate OVF manifest file
52 checksum=$(sha256sum $fname | cut -d' ' -f 1)
53 echo "SHA256($fname)= $checksum" >> box.mf
56 # 6. compress everything back together
57 tar --owner=0 --group=0 --sort=name --numeric-owner -czf $out .