nix3-store...t-addressed(1)
π nix3-store...t-addressed(1) β General Commands Manual π
okay bestie, quick heads-up before we dive in: this is the nix store make-content-addressed page from the General Commands Manual, and it's giving experimental energy.
β οΈ Warning β This program is experimental and its interface is subject to change. fr fr, it might get a glow-up without warning you. π«
β¨ Name β¨
nix store make-content-addressed β rewrite a path or closure to content-addressed form
πΈ Synopsis πΈ
nix store make-content-addressed [optionβ¦] installablesβ¦
π Examples π
- Create a content-addressed representation of the closure of GNU Hello:
# nix store make-content-addressed nixpkgs#hello
β¦
rewrote '/nix/store/10l19qifk7hjjq47px8m2prqk1gv4isy-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 be copied to another store β no cap π«Ά:
# 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. watch it just⦠not:
# nix copy --to /tmp/nix --trusted-public-keys '' nixpkgs#hello
cannot add path '/nix/store/gs7mh6q22l1ivxazxja2mjlsdwhw8zg9-libunistring-0.9.10' because it lacks a signature by a trusted key
- Create a content-addressed representation of the current NixOS system closure:
# nix store make-content-addressed /run/current-system
π Description π
This command converts the closure of the store paths specified by installables to content-addressed form. literally its whole job.
Nix store paths are usually input-addressed, meaning that the hash part of the store path is computed from the contents of the derivation (i.e., the build-time dependency graph). Input-addressed paths need to be signed by a trusted key if you want to import them into a store, because we need to trust that the contents of the path were actually built by the derivation. it's a whole trust-fall situation π
By contrast, in a content-addressed path, the hash part is computed from the contents of the path. This allows the contents of the path to be verified without any additional information such as signatures. slay, self-verifying. This means that a command like
# nix 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. iconic behaviour, honestly π
β Options β
--fromstore-uri β URL of the source Nix store.--jsonβ Produce output in JSON format, suitable for consumption by another program.--no-prettyβ Print compact JSON output on a single line, even when the output is a terminal. Some commands may print multiple JSON objects on separate lines.
See --pretty.
--prettyβ Print multi-line, indented JSON output for readability.
Default: indent if output is to a terminal.
This option is only effective when --json is also specified.
--stdinβ Read installables from the standard input. No default installable applied.--tostore-uri β URL of the destination Nix store.
π§ Common evaluation options π§
--argname expr β Pass the value expr as the argument name to Nix functions.--arg-from-filename path β Pass the contents of file path as the argument name to Nix functions.--arg-from-stdinname β Pass the contents of stdin as the argument name to Nix functions.--argstrname string β Pass the string string as the argument name to Nix functions.--debuggerβ Start an interactive environment if evaluation fails. cute lil safety net π«--eval-storestore-url β The URL of the Nix store to use for evaluation, i.e. to store derivations (.drvfiles) and inputs referenced by them.--impureβ Allow access to mutable paths and repositories.--include,-Ipath β Add path to search path entries used to resolve lookup paths
This option may be given multiple times.
Paths added through -I take precedence over the nix-path configuration setting and the NIX_PATH environment variable.
--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.
DEPRECATED
Use --no-use-registries instead.
--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.--output-lock-fileflake-lock-path β Write the given lock file instead offlake.lockwithin the top-level flake.--override-inputinput-path flake-url β Override a specific flake input (e.g.dwarffs/nixpkgs). The input path must not be empty. This implies--no-write-lock-file.--recreate-lock-fileβ Recreate the flakeβs lock file from scratch.
DEPRECATED
Use nix flake update instead.
--reference-lock-fileflake-lock-path β Read the given lock file instead offlake.lockwithin the top-level flake.--update-inputinput-path β Update a specific flake input (ignoring its previous entry in the lock file).
DEPRECATED
Use nix flake update instead.
π¦ Logging-related options π¦
--debugβ Set the logging verbosity level to βdebugβ.--log-formatformat β Set the format of log output; one ofraw,internal-json,barorbar-with-logs.--print-build-logs,-Lβ Print full build logs on standard error.--quietβ Decrease the logging verbosity level.--verbose,-vβ Increase the logging verbosity level.
π Miscellaneous global options π
--helpβ Show usage information.--offlineβ Disable substituters and consider all previously downloaded files up-to-date.--optionname value β Set the Nix configuration setting name to value (overridingnix.conf).--refreshβ Consider all previously downloaded files out-of-date.--repairβ During evaluation, rewrite missing or corrupted files in the Nix store. During building, rebuild missing or corrupted store paths.--versionβ Show version information.
π Options that change the interpretation of installables π
--allβ Apply the operation to every store path.--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. If file is the character-, then a Nix expression is read from standard input. Implies--impure.--recursive,-rβ Apply operation to closure of the specified paths.
π Note β See man nix.conf for overriding configuration settings with command line flags.
aaaand that's the whole page, bestie π you made it to the bottom, main character energy fr.
This was nix3-store...t-addressed(1) from the General Commands Manual β and yes, the page even signs off by repeating its own name at the bottom, which is lowkey iconic of it. mwah, bye πβ¨
π¦ where this page comes from
- fedora 44: nix-core 2.35.3-2.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms