From f54d9ebbadb728e749c0175376278cc71729d9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Fri, 18 Nov 2022 12:47:11 +0100 Subject: [PATCH] Use deduplicating nix for nix copy operations --- .github/workflows/build.yml | 8 ++++---- scripts/post-build-hook | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c454b17..0aaf09d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,5 @@ name: build on: - push: - branches: - - main pull_request: branches: - main @@ -68,8 +65,11 @@ jobs: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs= experimental-features = nix-command flakes ca-derivations - post-build-hook = ${{ github.workspace }}/scripts/post-build-hook substituters = https://cache.chir.rs/ + - name: Download patched nix + run: nix build github:DarkKirb/nix-packages#nix-s3-dedup + - name: Setup post-build-hook + run: echo "post-build-hook = ${{ github.workspace }}/scripts/post-build-hook" | sudo tee -a /etc/nix/nix.conf - name: Set up secrets run: | echo "$NIX_CACHE_KEY" > ~/cache.key diff --git a/scripts/post-build-hook b/scripts/post-build-hook index 2f6e09f..b4b056e 100755 --- a/scripts/post-build-hook +++ b/scripts/post-build-hook @@ -2,4 +2,4 @@ set -euf export IFS=' ' /nix/var/nix/profiles/default/bin/nix store sign --key-file /home/runner/cache.key $DRV_PATH -/nix/var/nix/profiles/default/bin/nix 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 \ No newline at end of file +/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 \ No newline at end of file