Skip to content

Add nix store import and nix store export commands to work with nar/narinfo #9038

@fricklerhandwerk

Description

@fricklerhandwerk

This is part of the CLI stabilisation effort.

Description

The commands should convert between store objects and nar/narinfo .
Since we're not settled on a format, require passing a format flag. This allows to add more formats later and set a default once we're confident this something that can be supported in the long term.

Warning

The current export format does not support CA and is not extensible.

Example

$ nix store export <store path> --format tar
# ... tar stream with nar and narinfo files
$ nix store import <path>...
/nix/store/<hash>-<name>
# more paths

TODO: Clarify CLI guideline in terms of reading from stdin

Context

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposalnew-cliRelating to the "nix" command

    Type

    No type

    Projects

    Status

    Defined work

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions