sops-nix icon indicating copy to clipboard operation
sops-nix copied to clipboard

Not restarting home-manager service when rebuilding

Open arthsmn opened this issue 1 year ago • 3 comments

I have home-manager as a nixos module and noticed that when I rebuild I have to manually restart the sops-nix service, I would like to request that you make the home-manager module do this by itself.

arthsmn avatar Jan 08 '24 22:01 arthsmn

Does home-manager restart services these days? I am only aware of it proposing services to be restarted.

Mic92 avatar Jan 24 '24 08:01 Mic92

It seems that home-manager can restart services based on a diff - so if something changed in the file. If one needs to use something like systemd.user.services.restartTriggers in home-manager it can be done via X-SwitchMethod in the [Unit] section.

See related home-manager issue / question: https://github.com/nix-community/home-manager/issues/3865

Since sops-nix has a home-manager module which uses systemd user services it would be more consistent to also handle a restart of the service.

w4tsn avatar Feb 06 '24 08:02 w4tsn

See duplicate issue #478 with a longer discussion and a work-around using config in home.nix.

w4tsn avatar Feb 15 '24 17:02 w4tsn

Closing as the workaround was added in the README in this commit.

arthsmn avatar Mar 31 '24 14:03 arthsmn