Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic garbage collection #42

Open
Tommixe opened this issue Jan 10, 2025 · 0 comments
Open

Automatic garbage collection #42

Tommixe opened this issue Jan 10, 2025 · 0 comments

Comments

@Tommixe
Copy link

Tommixe commented Jan 10, 2025

Hello,
does the option "--delete-older-than +3" (with the +3 argument) work for you in the garbage collection service?(hosts/common/global/nix.nix file)

gc = {
automatic = true;
dates = "weekly";
# Keep the last 3 generations
options = "--delete-older-than +3";
};

I get an error since the command nix-collect-garbage expect a period, like 14d, and not a number of generations to keep.

gen 08 15:51:56 ws02 nix-gc-start[5075]: removing old generations of profile /nix/var/nix/profiles/system
gen 08 15:51:56 ws02 nix-gc-start[5075]: error: invalid number of days specifier '+3', expected something like '14d'
gen 08 15:51:56 ws02 nix-gc-start[5075]: Try '/nix/store/yskyk1xf37fzf525xdppblg0qlji2nrf-nix-2.24.11/bin/nix-collect-garbage --help' for more information.
gen 08 15:51:56 ws02 systemd[1]: nix-gc.service: Main process exited, code=exited, status=1/FAILURE

Looking at the documentation it seems that only the command nix-env --delete-generations accept + argument.

Thanks for your amazing work!
Tommaso

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant