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
- Delete a specific store path:
# nix store delete /nix/store/fdhrijyv3670djsgprx596nn89iwlj2s-hello-2.10
- Garbage collect a closure:
# nix store delete --recursive --skip-alive nixpkgs#hello
- 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β readinstallablesfrom the standard input. no default installable applied. π
π 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. lil debugging hangout spot π«Ά--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. 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-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'. spill the tea β--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. 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.--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. all of them. every last one π--derivationβ operate on the store derivation rather than its outputs.--exprexpr β interpretinstallablesas attribute paths relative to the Nix expression expr.--file/-ffile β interpretinstallablesas 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
- 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