bza
August 2, 2026, 3:29pm
1
Hi,
just trying system-manager for the 1st time. The system I’m using it on does not have too much disk space available. I wonder
how one would clean the nix store managed by system-manager, and
if it would help to build on another machine?
Thanks!
1 Like
bza
August 2, 2026, 3:31pm
2
Summoning @zimbatm or @Mic92 - hope you don’t mind
NobbZ
August 2, 2026, 3:59pm
3
Do garbage collections and keep the system closures small. Whether you use System-Manager, home-manager, nixOS, or just plain nix doesn’t really change anything about this.
Understand what nix considers garbage and what it doesn’t, and make sure that nix has roughly the same understanding as you.
1 Like
bza
August 2, 2026, 5:38pm
4
Ah ok, thank you.
I think in the past I already had a way to list GC roots, etc. on nixos.
So I think I will just try the usual GC commands and see, b/c I had to stop some larger installation. I should see some space being freed up.
I use @linyinfeng ’s angrr to automatically clean up gcroots. Example system-manager config:
systemManager =
{
pkgs,
inputs',
...
}:
{
environment = {
etc."angrr/config.toml".source = (pkgs.formats.toml { }).generate "angrr/config.toml" angrrConfig;
systemPackages = [ inputs'.angrr.packages.default ];
};
systemd = {
services.angrr = {
description = "Auto Nix GC Roots Retention";
environment.ANGRR_LOG_STYLE = "systemd";
script = ''
${lib.getExe inputs'.angrr.packages.default} run \
--log-level "info" \
--no-prompt
'';
This file has been truncated. show original
1 Like
bza
August 2, 2026, 9:14pm
6
Thank you very much. Will check.
1 Like
bza
August 4, 2026, 10:27am
7
Just to close this up. I now have an angrr service similar to yours. Works, ig.
Added another service calling nix-collect-garbage -d every night.
So, thank you again!
1 Like