1
1
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-10-04 00:19:39 +03:00
1 Deleting old generations
c4710n edited this page 2020-10-26 11:19:00 +08:00

For single-user installation

Run nix-collect-garbage -d as normal.

For multi-user installation

TLDR: sudo nix-collect-garbage -d

On a multi user installation permissions of profiles is split between root and per user profiles. In this case the root profile manages the version of nix that's installed. Only per user profiles are owned by each user respectively so packages can be installed without privileges. The nix-darwin system profile also falls under root since it takes a similar place as the initial root profile.

The darwin-rebuild command automatically uses sudo in the appropriate places when switching to a new system, but nix-collect-garbage doesn't and thus won't have permissions to touch the system generations unless executed with sudo explicitly.