# `mix nbpr.pack`
[🔗](https://github.com/jimsynz/nbpr/blob/v0.7.0/lib/mix/tasks/nbpr.pack.ex#L1)

Produces a canonical nbpr artefact tarball from already-built files on disk.

    mix nbpr.pack \
        --package nbpr_jq \
        --package-version 1.7.1 \
        --system nerves_system_rpi4 \
        --system-version 2.0.1 \
        --target /path/to/built/target \
        [--staging /path/to/built/staging] \
        [--rootfs /path/to/built/rootfs] \
        [--legal-info /path/to/built/legal-info] \
        [--build-opts key=value,key2=value2] \
        [--upstream-version 0.6.1-103-g6dd5d33] \
        [-o /output/dir]

Outputs a `<package>-<version>-<system>-<system-version>-<key>.tar.gz` in
`-o` (defaults to `cwd`). The tarball follows the layout consumed by
`NBPR.Artifact.Cache.extract!/2`.

`--upstream-version` belongs only to a package that has decoupled its Hex
version from Buildroot's — it joins the cache key and the manifest, and
must match the package's `upstream_version:` declaration or the tarball
lands under a key nothing will look for. Leave it off otherwise.

Useful for hand-built artefacts (you ran Buildroot yourself) and as a
building block for the eventual `mix nbpr.build` task.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
