Last active
June 4, 2020 17:40
-
-
Save evanjs/1fa1e1d3379750143347762164ed18e4 to your computer and use it in GitHub Desktop.
Generate ESXi-compatible virtual appliance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgs.runCommand "fix-appliance-esxi" {} | |
'' | |
mkdir $out | |
mkdir ova | |
pushd ova | |
echo "Tar command: tar -xvf ${vboxImage}/*.ova" | |
tar -xvf ${vboxImage}/*.ova | |
ovf=$(ls -1 *.ovf) | |
mf=$(ls -1 *.mf) | |
vmdk=$(ls -1 *.vmdk) | |
sed 's;\(.*<vssd:VirtualSystemType>\).*\(</vssd:VirtualSystemType>\);\1vmx-14\2;;' -i nixos-20.09pre-git-x86_64-linux.ovf | |
sum=$(sha1sum $ovf | cut -d ' ' -f-1) | |
substituteInPlace $mf --replace "SHA1 ($ovf) = .*" "SHA1 ($ovf) = $sum" | |
tar -cvf nixos.ova $ovf $mf $vmdk | |
cp nixos.ova $out | |
''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment