[Nix-dev] (sudo (-H)) nix-collect-garbage
Florian Friesdorf
flo at chaoflow.net
Fri Jul 27 12:26:41 CEST 2012
On Mon, 02 Jul 2012 10:39:03 -0400, Eelco Dolstra <eelco.dolstra at logicblox.com> wrote:
> Hi,
>
> On 02/07/12 10:09, Florian Friesdorf wrote:
>
> > can somebody explain me what is going on here? Summary:
> >
> > - garbage collect as user
> > - rerun garbage collect as user -> nothing to do
> > - sudo garbage collect -> more work to do including scary
> > 'invalidating' actions
> >
> > Why is root garbage collecting more than user?
>
> Because you're using sudo and sudo doesn't propagate the $NIX_CONF_DIR
> environment variable. Because of this the Nix configuration file in
> /etc/nix/nix.conf won't be used. By default it contains a line "gc-keep-outputs
> = true" which prevents the outputs of derivations from being garbage collected.
> This explains that "sudo nix-collect-garbage" will suddenly garbage-collect
> tarballs like "xmonad-0.10.tar.gz".
>
> Maybe we should add an "env_keep" line for $NIX_CONF_DIR to sudoers.
just pushed after testing it locally:
% nix-collect-garbage
cleaning
% sudo nix-collect-garbage
nothing to be done
% sudo -H nix-collect-garbage
nothing to be done
--
Florian Friesdorf <flo at chaoflow.net>
GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: flo at chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20120727/032e00a7/attachment.bin
More information about the nix-dev
mailing list