From beee18de881040e3d7861be694fc3c66e9bf4159 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 5 Oct 2006 23:13:15 +0000 Subject: [PATCH] * Document nix-store --delete. --- doc/manual/nix-hash.xml | 9 ++++--- doc/manual/nix-store.xml | 57 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/doc/manual/nix-hash.xml b/doc/manual/nix-hash.xml index 3a28fe4c6b..227eb94217 100644 --- a/doc/manual/nix-hash.xml +++ b/doc/manual/nix-hash.xml @@ -39,10 +39,11 @@ available as well. The hash is printed in hexadecimal. The hash is computed over a serialisation of each path: a dump of the file system tree rooted at the path. This allows directories and symlinks to be hashed as well as regular files. -The dump is in the NAR format produced by -nix-store . Thus, -nix-hash path yields the -same cryptographic hash as nix-store --dump +The dump is in the NAR format produced by nix-store +. Thus, nix-hash +path yields the same +cryptographic hash as nix-store --dump path | md5sum. diff --git a/doc/manual/nix-store.xml b/doc/manual/nix-store.xml index 8875b0f69c..0a7ecdf067 100644 --- a/doc/manual/nix-store.xml +++ b/doc/manual/nix-store.xml @@ -256,6 +256,11 @@ and gc-keep-derivations variables in the Nix configuration file. +With , the collector prints the total +number of freed bytes when it finishes (or when it is interrupted). +With , it prints the number of bytes that +would be freed. + @@ -264,7 +269,10 @@ variables in the Nix configuration file. To delete all unreachable paths, just do: -$ nix-store --gc +$ nix-store --gc +deleting `/nix/store/kq82idx6g0nyzsp2s14gfsc38npai7lf-cairo-1.0.4.tar.gz.drv' +... +8825586 bytes freed (8.42 MiB) @@ -275,6 +283,51 @@ $ nix-store --gc + + +Operation <option>--delete</option> + +Synopsis + + + nix-store + + + paths + + + + +Description + +The operation deletes the store paths +paths from the Nix store, but only if it is +safe to do so; that is, when the path is not reachable from a root of +the garbage collector. This means that you can only delete paths that +would also be deleted by nix-store --gc. Thus, +--delete is a more targeted version of +--gc. + +With the option , reachability +from the roots is ignored. 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). + + + +Example + + +$ nix-store --delete /nix/store/zq0h41l75vlb4z45kzgjjmsjxvcv1qk7-mesa-6.4 +0 bytes freed (0.00 MiB) +error: cannot delete path `/nix/store/zq0h41l75vlb4z45kzgjjmsjxvcv1qk7-mesa-6.4' since it is still alive + + + + + + + Operation <option>--query</option> @@ -675,7 +728,7 @@ in Nix itself. -Operation <option>--dump</option> +Operation <option>--dump</option> Synopsis