nix3-flake-prefetch(1)
β¨ nix3-flake-prefetch(1) β¨
It's giving manual page, bestie β this one lives in the General Commands Manual, and we're about to read it together like it's the group chat. π«Ά
β οΈ Warning β this program is experimental and its interface is subject to change. No cap. Don't build your whole personality on it yet. π
πΈ Name πΈ
nix flake prefetch β download the source tree denoted by a flake reference straight into the Nix store. π
π¦ Synopsis π¦
nix flake prefetch [optionβ¦] flake-url
π Examples π
- Grab a tarball and unpack it:
# nix flake prefetch https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.5.tar.xz --out-link ./result
Downloaded 'https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.5.tar.xz?narHash=sha256-3XYHZANT6AFBV0BqegkAZHbba6oeDkIUCDwbATLMhAY='
to '/nix/store/sl5vvk8mb4ma1sjyy03kwpvkz50hd22d-source' (hash
'sha256-3XYHZANT6AFBV0BqegkAZHbba6oeDkIUCDwbATLMhAY=').
# cat ./result/README
Linux kernel
β¦
- Or snag the
dwarffsflake (it gets looked up in the flake registry for you, so cute):
# nix flake prefetch dwarffs --json
{"hash":"sha256-VHg3MYVgQ12LeRSU2PSoDeKlSPD8PYYEFxxwkVVDRd0="
,"storePath":"/nix/store/l06r23gw4psl1f547il2hbnwnxaplbaz-source"}
π Description π
This command downloads the source tree denoted by the flake reference flake-url. And here's the plot twist, bestie: it does not need to be a flake β like, it literally does not have to contain a flake.nix file. It's just out here fetching trees, minding its business. π
β¨ Options β¨
--jsonβ spit the output out in JSON format, so another program can snack on it. π--no-prettyβ print compact JSON on a single line, even when the output is going to a terminal. Some commands may print multiple JSON objects on separate lines. See--pretty.--out-link,-opath β make a symlink named path pointing at the resulting store path. π--prettyβ print multi-line, indented JSON so it's actually readable. Default: indent if output is to a terminal. This option is only effective when--jsonis also specified. β
π§ 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. π--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-Itake precedence over thenix-pathconfiguration setting and theNIX_PATHenvironment 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.
π Note β see man nix.conf for overriding configuration settings with command line flags.
And that's the whole page, bestie β you ate. π Stay hydrated, keep your lock files close, and remember: experimental means subject to change, so vibe responsibly. β¨π¦
Signing off from the General Commands Manual, this was nix3-flake-prefetch(1) β mwah. π
π¦ 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