serokell / deploy-rs

A simple multi-profile Nix-flake deploy tool.
Other
1.42k stars 101 forks source link

deployed home-manager profiles do not clean up managed files #286

Open menixator opened 3 months ago

menixator commented 3 months ago

I noticed this issue while trying to remove the ssh configs from a server I manage. The server has home-manager installed stand-alone.

Removing all the ssh configs does not remove the ssh_config file linked to the old generation. Somehow deploy-rs is inhibiting home-manager's cleanup functions.

I suspect it might have something to do with the fact that deploy-rs ends up creating two separate generations for every home-manager deployment but I haven't looked too deep into it. Will try to look into it further and update this issue.

menixator commented 3 months ago

Defining a profilePath like so seems to have resolved this issue:

profilePath = "${self.homeConfigurations."user@host"}/nix/profiles/deployable-home";

by default the profile name ended up being "home-manager" and this ended up squeezing the "activatable-home-manager-generation" into the home-manager generations and preventing the cleanup.

image

Could we perhaps document how to properly use home-manager standalone with deploy-rs in the README?