From 8b70f138e02d62214715f144b133bf1b981911df Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 8 Apr 2005 13:00:38 +0000 Subject: * Lots of manual updates, in particular the new `nix-store --query' options were documented, as well as the Nix configuration file. --- doc/manual/package-management.xml | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'doc/manual/package-management.xml') diff --git a/doc/manual/package-management.xml b/doc/manual/package-management.xml index 0b0e57504a37..b827ae75b6c5 100644 --- a/doc/manual/package-management.xml +++ b/doc/manual/package-management.xml @@ -369,30 +369,39 @@ $ nix-env --delete-generations 10 11 14 garbage collector as follows: -$ nix-collect-garbage +$ nix-store --gc -You can alo first view what files would be deleted: +If you are feeling uncertain, you can also first view what files would +be deleted: -$ nix-collect-garbage --print-dead +$ nix-store --gc --print-dead Likewise, the option will show the paths that won’t be deleted. + Garbage collector roots -TODO - -The garbage collector uses as roots all store expressions -mentioned in all files with extension .gcroot in -the directory -prefix/var/nix/gcroots/, -or in any file or directory symlinked to from that directory. E.g., -by default, -prefix/var/nix/gcroots/ -contains a symlink to -prefix/var/nix/profiles/, -so all generations of all profiles are also roots of the collector. +The roots of the garbage collector are all store paths to which +there are symlinks in the directory +prefix/nix/var/nix/gcroots. +For instance, the following command makes the path +/nix/store/d718ef...-foo a root of the collector: + + +$ ln -s /nix/store/d718ef...-foo /nix/var/nix/gcroots/bar + +That is, after this command, the garbage collector will not remove +/nix/store/d718ef...-foo or any of its +dependencies. + +Subdirectories of +prefix/nix/var/nix/gcroots +are also searched for symlinks. Symlinks to non-store paths are +followed and searched for roots, but symlinks to non-store paths +inside the paths reached in that way are not +followed to prevent infinite recursion. -- cgit 1.4.1