nix3-store...addressable(1)
π nix3-store...addressable(1) β General Commands Manual
okay bestie, welcome to the manual page for nix store make-content-addressable, straight outta the General Commands Manual β¨
β οΈ Warning: this program is experimental and its interface is subject to change. no cap. it might glow up and change on you, so don't get too attached to the exact flags, okay? π
πΈ Name
nix store make-content-addressable β rewrite a path or closure to content-addressed form π
β¨ Synopsis
nix store make-content-addressable [optionβ¦] installablesβ¦
π¦ Examples
- Create a content-addressed representation of the closure of GNU Hello:
# nix store make-content-addressable -r nixpkgs#hello
β¦
rewrote '/nix/store/v5sv61sszx301i0x6xysaqzla09nksnd-hello-2.10' to '/nix/store/5skmmcb9svys5lj3kbsrjg7vf2irid63-hello-2.10'
Since the resulting paths are content-addressed, they are always trusted and donβt need signatures to copied to another store:
# nix copy --to /tmp/nix --trusted-public-keys '' /nix/store/5skmmcb9svys5lj3kbsrjg7vf2irid63-hello-2.10
By contrast, the original closure is input-addressed, so it does need signatures to be trusted:
# nix copy --to /tmp/nix --trusted-public-keys '' nixpkgs#hello
cannot add path '/nix/store/zy9wbxwcygrwnh8n2w9qbbcr6zk87m26-libunistring-0.9.10' because it lacks a valid signature
- Create a content-addressed representation of the current NixOS system closure:
# nix store make-content-addressable -r /run/current-system
π Description
This command converts the closure of the store paths you name in installables into content-addressed form. here's the tea: Nix store paths are usually input-addressed, which means the hash part of the store path gets computed from the contents of the derivation (aka the build-time dependency graph). and input-addressed paths need to be signed by a trusted key if you wanna import them into a store, because we have to trust that the contents of the path were actually built by that derivation. it's giving "trust me bro" energy, and Nix is not about that life π
By contrast, in a content-addressed path, the hash part is computed from the contents of the path itself. so the contents can be verified with zero extra info β no signatures, no receipts, nothing. which means a command like this:
# nix store build /nix/store/5skmmcb9svys5lj3kbsrjg7vf2irid63-hello-2.10 \
--substituters https://my-cache.example.org
will succeed even if the binary cache https://my-cache.example.org doesnβt present any signatures. slay. iconic. that's the whole point π
π Options
--jsonβ produce output in JSON format, suitable for consumption by another program. for when a human isn't the one reading it π«Ά
π§ Common evaluation options
--argname expr β pass the value expr as the argument name to Nix functions.--argstrname string β pass the string string as the argument name to Nix functions.--eval-storestore-url β the Nix store to use for evaluations.--impureβ allow access to mutable paths and repositories. living dangerously, love that for you β¨--include/-Ipath β add path to the list of locations used to look up<...>file names.--override-flakeoriginal-ref resolved-ref β override the flake registries, redirecting original-ref to resolved-ref.
π Common flake-related options
--commit-lock-fileβ commit changes to the flakeβs lock file.--inputs-fromflake-url β use the inputs of the specified flake as registry entries.--no-registriesβ donβt allow lookups in the flake registries. This option is deprecated; use--no-use-registries. girl, it's over, move on π--no-update-lock-fileβ do not allow any updates to the flakeβs lock file.--no-write-lock-fileβ do not write the flakeβs newly generated lock file.--override-inputinput-path flake-url β override a specific flake input (e.g.dwarffs/nixpkgs). this implies--no-write-lock-file.--recreate-lock-fileβ recreate the flakeβs lock file from scratch.--update-inputinput-path β update a specific flake input (ignoring its previous entry in the lock file).
β Options that change the interpretation of installables
--allβ apply the operation to every store path. all of them. every single one. periodt.--derivationβ operate on the store derivation rather than its outputs.--exprexpr β interpret installables as attribute paths relative to the Nix expression expr.--file/-ffile β interpret installables as attribute paths relative to the Nix expression stored in file.--recursive/-rβ apply operation to closure of the specified paths. the closure!! we love a closure π
that's the whole page bestie, hope you ate π this was the nix3-store...addressable(1) page from the General Commands Manual β go forth and make things content-addressed, you've got this πβ¨
π¦ where this page comes from
- ubuntu jammy: nix-bin 2.6.0+dfsg-3 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms