NixOS / nixops

NixOps is a tool for deploying to NixOS machines in a network or cloud.
https://nixos.org/nixops
GNU Lesser General Public License v3.0
1.87k stars 364 forks source link

Switching network.enableRollback from true to false leaves behind old profile #1414

Open hmenke opened 4 years ago

hmenke commented 4 years ago

Some time ago I had network.enableRollback = true on my laptop but then decided that I don't really need this because I naturally have full physical access to this machine, so I set network.enableRollback = true.

Over time I started running low on disk space but I could not garbage collect large parts of the store that seemed to be unused. Eventually I found that all of these were referred to by some old generation that should have been garbage collected months ago. Following the referrers led me to /nix/var/nix/profiles/per-user/root/nixops/ where there was a link left to an ancient generation. Deleting this link and a subsequent nix-collect-garbage freed 16 GB of disk space.

I don't know whether there is an easy way to trigger removal of old profiles when disabling rollbacks but at least this should be documented that when setting network.enableRollback from true to false old generations have to be taken care of manually.

$ nixops --version
NixOps 1.7