@cryptotaxi247 / infra / commits / a0453be9

macs: install Nix from a prefetched installer

Graham Christensen committed Oct 18, 2021 at 19:30 UTC a0453be95f23beaf5fa536a7d33a32758c730313
2 files changed +12 -4
macs/guest/apply.sh
+2 -3
@@ -49,9 +49,8 @@ echo "%admin ALL = NOPASSWD: ALL" | tee /etc/sudoers.d/passwordless
49 export HOME=~root
50 export ALLOW_PREEXISTING_INSTALLATION=1
51 env
52 - curl -vL https://nixos.org/releases/nix/nix-2.3.3/install > ~nixos/install-nix
53 - chmod +rwx ~nixos/install-nix
54 - cat /dev/null | sudo -i -H -u nixos -- sh ~nixos/install-nix --daemon
52 +
53 + sudo -i -H -u nixos -- sh /Volumes/CONFIG/install --daemon < /dev/null
54 )
55
56 (
macs/host/qemu.nix
+10 -1
@@ -36,13 +36,22 @@ in {
36
37 serviceConfig.PrivateTmp = true;
38
39 - preStart = ''
39 + preStart = let
40 + nixInstall = pkgs.fetchurl {
41 + url = "https://nixos.org/releases/nix/nix-2.3.10/install";
42 + sha256 = "8fa6f064bf758adf501deb35c6837b8c4f9402f66ff86964537524103376958e";
43 + };
44 + in ''
45 zfs rollback ${snapshot}
46
47 # Create a cloud-init style cdrom
48 rm -rf /tmp/cdr
49 cp -r ${persistentConfigDir} /tmp/cdr
50 rsync -r ${guestConfigDir}/ /tmp/cdr
51 +
52 + cp ${nixInstall} /tmp/cdr/install
53 + chmod +x /tmp/cdr/install
54 +
55 cd /tmp/cdr
56 find .
57 genisoimage -v -J -r -V CONFIG -o /tmp/config.iso .