Content-addressed: how do derivation->realization mappings migrate?

Hi, could somebody please explain/reassure me on how derivation->realization mappings are supposed to migrate between two content-addressed Nix stores? I’m specifically interested in

  1. Querying them from substituters. There’s some new extra API for that, right? Is it fully orthogonal to the “regular” requests?
  2. Storing them in /nix/store. They just live in the sqlite file and nowhere else?
  3. Exporting them for import into a different store. I’m under the impression that nix-store --export doesn’t include them (thus the separate protocol extension), so whatever you --import will not be picked up and will have to be rebuilt anyway to establish the mapping, making the whole ordeal useless.

So, if I have one store and another store, how ca-derivations are supposed to migrate between them in a way that takes their mappings with them? For networked substituters case and, separately, for offline local transfers case.

Breadcrumbs to self:

  1. Querying from substituters uses /realisations/$HASH.doi, Nix implements that as a client, none of the servers I’ve checked (hydra, nix-serve, eris, harmonia, nix-serve-ng, attic) seem to route it.
  2. Seems like they exist in sqlite only, yes
  3. Three revelations here, from most to least obvious:
    a. one needs to copy .drvs, not just store paths (duh)
    b. one needs to copy *.drv^*, not just *.drv (okay)
    c. --to /path is vastly different from --to file:///path (big huh), with the former one creating a store and the latter one creating a binary cache