diff --git a/artiq/windows/README.md b/artiq/windows/README.md index 147ac49..69c1a13 100644 --- a/artiq/windows/README.md +++ b/artiq/windows/README.md @@ -1,13 +1,20 @@ -# Preparing a Windows image +# Preparation steps + +## Install a Windows image ```shell nix-build install.nix -result/bin/networked-installer.sh +result/bin/windows-installer.sh ``` Follow the instructions. -Then press **return** to automatically complete the installation via SSH. The virtual machine will be shut down when the process is complete. +## Install Anaconda to the image + +```shell +nix-build install.nix +result/bin/anaconda-installer.sh +``` Move the image `c.img` to one of Nix' `extra-sandbox-paths` (`nix.sandboxPaths` on NixOS). diff --git a/artiq/windows/install.nix b/artiq/windows/install.nix index 821a0d6..cdf3955 100644 --- a/artiq/windows/install.nix +++ b/artiq/windows/install.nix @@ -47,29 +47,29 @@ stdenv.mkDerivation { installPhase = '' mkdir -p $out/bin $out/data ln -s $(readlink windows.iso) $out/data/windows.iso - cat > $out/bin/networked-installer.sh << EOF + cat > $out/bin/windows-installer.sh << EOF #!/usr/bin/env bash set -e -m - if [ ! -f c.img ] ; then - ${qemu.qemu-img} create -f qcow2 c.img ${diskImageSize} - ${qemu.runQemu false [ - "-boot" "order=d" - "-drive" "file=c.img,index=0,media=disk,cache=unsafe" - "-drive" "file=$out/data/windows.iso,index=1,media=cdrom,cache=unsafe" - ]} & - echo "Please perform a Windows installation." - else - echo "Please finalize your Windows installation (or delete c.img and restart)" - ${qemu.runQemu false [ - "-boot" "order=c" - "-drive" "file=c.img,index=0,media=disk" - ]} & - fi + ${qemu.qemu-img} create -f qcow2 c.img ${diskImageSize} + ${qemu.runQemu false [ + "-boot" "order=d" + "-drive" "file=c.img,index=0,media=disk,cache=unsafe" + "-drive" "file=$out/data/windows.iso,index=1,media=cdrom,cache=unsafe" + ]} & cat ${instructions} + wait + EOF - read + cat > $out/bin/anaconda-installer.sh << EOF + #!/usr/bin/env bash + set -e -m + ${qemu.runQemu false [ + "-boot" "order=c" + "-drive" "file=c.img,index=0,media=disk" + ]} & + sleep 10 ${ssh "ver"} ${scp anaconda "Anaconda.exe"} @@ -86,6 +86,6 @@ stdenv.mkDerivation { echo "Waiting for qemu exit" wait EOF - chmod a+x $out/bin/networked-installer.sh + chmod a+x $out/bin/*.sh ''; }