diff --git a/ops/nixos/lib/switch-prebuilt.nix b/ops/nixos/lib/switch-prebuilt.nix index 4adbb16a27..7820cb557d 100644 --- a/ops/nixos/lib/switch-prebuilt.nix +++ b/ops/nixos/lib/switch-prebuilt.nix @@ -10,8 +10,11 @@ pkgs.writeShellScriptBin "switch-prebuilt" '' export AWS_SECRET_ACCESS_KEY="${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}" system="''${1}" - # We should be a trusted-user. - nix copy -v --from 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' --no-check-sigs "$system" + if [[ ! -e "$system" ]]; then + # We should be a trusted-user. + nix copy -v --from 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' --no-check-sigs "$system" + fi + diff "$system/etc/hostname" "/etc/hostname" # The next phase requires sudo, but it's harmless to run the preceding commands twice.