Hi Matthew,

> Is there any recommended way to have guix gc only delete packages that
> aren't required to build anything?

This requirement is a little vague.  Do you mean to only delete leaf
packages?  Or do you just want to keep a version of GCC?

You could create an environment containing all dependencies for a
package of interest and register it as a GC root, so it won’t be
collected.  For example:

    guix environment --root=$HOME/.dev-env guile

Then you can run “guix gc” with reckless abandon and be sure that at
least the dependencies of the “guile” package (at that particular
version of Guix) will not be collected.

There is also a daemon option, which might be of interest to you, though
it may keep more (or less) than what you want:

    --gc-keep-derivations[=yes/no]
                tell whether the GC must keep derivations
                corresponding to live outputs

Hope this helps!

--
Ricardo


Reply via email to