Alternative to `nix-build-uncached` when using flakes?

I have a github action for an internal project which populates an S3 cache, currently using 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 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.

  1. Should nix have rebuilt that derivation? If not, how do I make it do so?
  2. How do I make sure derivations are signed properly before upload?
  3. Is there some other way to do this?

I’m arranging currently to get this feature funded and implemented in Nix.

1 Like