I’m trying to backup the complete Nix store into a single file to then restore it on a different host. I’m trying to do this in the least hacky way possible. I think what I wish existed is nix-store --export --all. But there seems to be no (standard) way to emulate this by listing all store paths. Also nix-store doesn’t support --stdin and passing tens of thousands of arguments seems problematic as well.
Another approach I considered is nix-copy --to file://... --stdin, but it still boils down to the problem of listing all store paths.
As far as I can tell the format of nix-store --dump-db is not documented either.
So tl;dr:
- Is there a way to list all the store paths in a given Nix store?
- Alternatively: Is there something like
nix-store --export --all?