I have a github action for an internal project which populates an S3 cache, currently using https://github.com/Mic92/nix-build-uncached and a post-build hook which signs and uploads the derivation. I want to move that project to flakes (and have done all the nix-side work) but how do I get this caching behaviour? In issue https://github.com/nixos/nix/issues3946 there’s a mention of nix-build --store $remote_store --builders auto
, so I tried nix build --store s3://private-nix-cache .#some-flake-output
. It uploaded /nix/store/<hash>.narinfo
, then failed because /nix/store/<hash>-source
didn’t exist.
- Should nix have rebuilt that derivation? If not, how do I make it do so?
- How do I make sure derivations are signed properly before upload?
- Is there some other way to do this?