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 dwarffs flake (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, -o path β€” 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 --json is also specified. ⭐

🧚 Common evaluation options 🧚

  • --arg name expr β€” pass the value expr as the argument name to Nix functions.
  • --arg-from-file name path β€” pass the contents of file path as the argument name to Nix functions.
  • --arg-from-stdin name β€” pass the contents of stdin as the argument name to Nix functions.
  • --argstr name string β€” pass the string string as the argument name to Nix functions.
  • --debugger β€” start an interactive environment if evaluation fails. πŸ›
  • --eval-store store-url β€” the URL of the Nix store to use for evaluation, i.e. to store derivations (.drv files) and inputs referenced by them.
  • --impure β€” allow access to mutable paths and repositories. πŸ™ˆ
  • --include, -I path β€” 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-flake original-ref resolved-ref β€” override the flake registries, redirecting original-ref to resolved-ref. πŸ”€

  • --commit-lock-file β€” commit changes to the flake's lock file.
  • --inputs-from flake-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-file flake-lock-path β€” write the given lock file instead of flake.lock within the top-level flake.
  • --override-input input-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-file flake-lock-path β€” read the given lock file instead of flake.lock within the top-level flake.
  • --update-input input-path β€” update a specific flake input (ignoring its previous entry in the lock file).
πŸ’€ DEPRECATED β€” use nix flake update instead.

  • --debug β€” set the logging verbosity level to β€˜debug’.
  • --log-format format β€” set the format of log output; one of raw, internal-json, bar or bar-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.
  • --option name value β€” set the Nix configuration setting name to value (overriding nix.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