nixos-config/scripts/post-build-hook

15 lines
740 B
Text
Raw Normal View History

2023-01-17 10:02:41 +00:00
#!/usr/bin/env bash
2022-11-16 15:05:54 +00:00
set -euf
export IFS=' '
2023-01-16 16:53:11 +00:00
export XDG_CONFIG_HOME=/home/runner/.config
2022-11-16 15:05:54 +00:00
/nix/var/nix/profiles/default/bin/nix store sign --key-file /home/runner/cache.key $DRV_PATH
/nix/var/nix/profiles/default/bin/nix run 'github:DarkKirb/nix-packages#nix-s3-dedup' -- copy --to 's3://cache-chir-rs?scheme=https&endpoint=s3.us-west-000.backblazeb2.com&secret-key=/home/runner/cache.key&multipart-upload=true&compression=zstd&compression-level=15' $DRV_PATH
2023-01-17 10:02:41 +00:00
max_retry=5
counter=0
while ! /nix/var/nix/profiles/default/bin/nix run 'github:DarkKirb/nix-packages#attic-client' -- push chir-rs $OUT_PATHS; do
sleep 5
[[ counter -eq $max_retry ]] && echo "Failed!" && exit 1
echo "Trying again. Try #$counter"
((counter++))
done