switch-prebuilt: check for existence before nix copy
This commit is contained in:
parent
422c47c3e0
commit
5cf89fbc2f
1 changed files with 5 additions and 2 deletions
|
@ -10,8 +10,11 @@ pkgs.writeShellScriptBin "switch-prebuilt" ''
|
||||||
export AWS_SECRET_ACCESS_KEY="${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}"
|
export AWS_SECRET_ACCESS_KEY="${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}"
|
||||||
system="''${1}"
|
system="''${1}"
|
||||||
|
|
||||||
# We should be a trusted-user.
|
if [[ ! -e "$system" ]]; then
|
||||||
nix copy -v --from 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' --no-check-sigs "$system"
|
# 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"
|
diff "$system/etc/hostname" "/etc/hostname"
|
||||||
|
|
||||||
# The next phase requires sudo, but it's harmless to run the preceding commands twice.
|
# The next phase requires sudo, but it's harmless to run the preceding commands twice.
|
||||||
|
|
Loading…
Reference in a new issue