I’m trying to set up a binary cache in an S3 bucket. (I can’t use cachix for security reasons.)
I got all the configuration, signing etc figured out but I’m stuck on actually populating the cache. Using
nix copy on the derivation uploads just derivations, not the actual outputs. Using
nix copy on the output uploads just the runtime dependencies.
I’ve even tried doing this:
nix-store --query --requisites --include-outputs “$derivation” | xargs nix copy --no-recursive --to “$cache_url”
That seems to work—lots of stuff gets uploaded—but when I try to build using only my cache and not cache.nixos.org, it downloads a lot of stuff from the cache and then starts trying bootstrap gcc from source. Apparently something crucial isn’t making it into the cache.
Does anybody know how to do this properly?