diff --git a/ops/nixos/lib/switch-prebuilt.nix b/ops/nixos/lib/switch-prebuilt.nix index 171b1e4425..d9379f0e75 100644 --- a/ops/nixos/lib/switch-prebuilt.nix +++ b/ops/nixos/lib/switch-prebuilt.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -{ depot, pkgs, ... }: +{ depot, system, pkgs, ... }: pkgs.writeShellScriptBin "switch-prebuilt" '' set -ue @@ -14,9 +14,11 @@ pkgs.writeShellScriptBin "switch-prebuilt" '' tmpdir="$(mktemp -d)" trap '{ rm -rf -- "$tmpdir"; }' EXIT - ${pkgs.curl}/bin/curl -so "$tmpdir/archive.zip" 'https://hg.lukegb.com/api/v4/projects/lukegb%2Fdepot/jobs/artifacts/branch%2Fdefault/download?job=nixCache' + ${pkgs.curl}/bin/curl -so "$tmpdir/archive.zip" 'https://hg.lukegb.com/api/v4/projects/lukegb%2Fdepot/jobs/artifacts/branch%2Fdefault/download?job=nixCache-${system}' ${pkgs.unzip}/bin/unzip -d "$tmpdir" -q -o "$tmpdir/archive.zip" system="$(${pkgs.jq}/bin/jq -r ".\"$(hostname)\"" "$tmpdir/systems.json")" + + echo "Switching to system ''$system" fi if [[ ! -e "$system" ]]; then