nix3-store-delete(1)

✨ nix3-store-delete(1) ✨

okay bestie, we're in the General Commands Manual and today's main character is nix3-store-delete(1) πŸ’–

⚠️ Warning β€” this program is experimental and its interface is subject to change. like, it WILL switch up on you, no cap 🫠

🌸 Name

nix store delete β€” delete paths from the Nix store πŸ—‘οΈβœ¨


πŸŽ€ Synopsis

nix store delete [option…] installables…

πŸ¦‹ Examples

  1. Delete a specific store path:
# nix store delete /nix/store/fdhrijyv3670djsgprx596nn89iwlj2s-hello-2.10
  1. Garbage collect a closure:
# nix store delete --recursive --skip-alive nixpkgs#hello
  1. Garbage collect a closure including dead referrers of the closure:
# nix store delete --recursive --skip-alive --also-referrers nixpkgs#hello

πŸ’… Description

So this command deletes the store paths you name in installables, but only if it is safe to do so β€” meaning when the path is not reachable from a root of the garbage collector. Translation: you can only delete paths that would also be deleted by nix store gc. So nix store delete is literally just a more targeted version of nix store gc, periodt. 🎯

Now, with the option --ignore-liveness, reachability from the roots is ignored entirely. However, the path still won't be deleted if there are other paths in the store that refer to it (i.e., depend on it). the way it refuses to let go 😭


✨ Options ✨

  • --also-referrers β€” also allow deletion of any referrers of the specified paths. let them go too bestie πŸ’€
  • --ignore-liveness β€” do not check whether the paths are reachable from a root. living on the edge, iconic πŸ™ˆ
  • --skip-alive β€” do not emit errors when attempting to delete something that is still alive, useful with --recursive.
  • --stdin β€” read installables from the standard input. no default installable applied. πŸ“

🌈 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. lil debugging hangout spot 🫢
  • --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. bestie this one's old news, 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.
  • --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'. spill the tea β˜•
  • --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. shhh 🀫
  • --verbose / -v β€” increase the logging verbosity level. yap mode activated πŸ—£οΈ

⭐ 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.

🧚 Options that change the interpretation of installables

  • --all β€” apply the operation to every store path. all of them. every last one πŸ‘‘
  • --derivation β€” operate on the store derivation rather than its outputs.
  • --expr expr β€” interpret installables as attribute paths relative to the Nix expression expr.
  • --file / -f file β€” 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.

and that's the whole page, you ate that πŸ’– if you made it all the way down here you're officially a Nix store deletion specialist, iykyk πŸŽ€

this beauty comes to you from the Nix 3 crew β€” nix3-store-delete(1), straight out of the General Commands Manual, floating at the bottom of the page like a lil signature ⭐ slay, stay safe, and don't delete anything alive fr fr πŸ¦‹

πŸ“¦ where this page comes from