I got all the configuration, signing etc figured out but I’m stuck on actually populating the cache.
We’re doing this exact thing at work. Here’s the commands we use from our CI:
$ nix-build
$ nix copy \
--to "s3://our-nix-cache-bucket-name?profile=our-profile-name&endpoint=our.endpoint.example.com" \
--option narinfo-cache-positive-ttl 0 \
$(nix-store --query --requisites --include-outputs $(nix-store --query --deriver ./result))
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.
When I try to build our local project from scratch for the first time, I believe some things are downloaded from cache.nixos.org and not our work nix cache. Although everything is downloaded from some cache, so we don’t have to build anything locally.
As @andir said, you probably want to run nix-build
with either the --debug
or --verbose
flags. You get quite a lot of output, but it is usually very helpful in debugging cache-related problems.