Created
June 7, 2022 10:03
-
-
Save zimbatm/ad72f89688fee7a52f9341f9306cd02c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
{ | |
# Configure nix to upload build results to the cache | |
nix.extraOptions = | |
let | |
post-build-hook = pkgs.writeShellScript "post-build-hook" '' | |
# | |
# Invoked by post-build hooks to upload new builds to the cache | |
# | |
set -euo pipefail | |
set -f # disable globbing | |
export IFS=' ' | |
echo "Uploading paths $OUT_PATHS" | |
source /run/secrets/nix_cache_writer | |
exec nix copy --extra-experimental-features nix-command --to "s3://manifold-nix-cache?region=us-west-2&secret-key=/run/secrets/nix_signing_key" $OUT_PATHS | |
''; | |
in | |
'' | |
post-build-hook = ${post-build-hook} | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment