Search code examples
nixnixos

How can I restart a service on Nixos?


I've enabled the emacs daemon in my 'nix' config via:

services.emacs.enable = true;

However I'd now like to restart the daemon, due to changing my emacs config.

How can I restart it?

systemctl list-unit-files | grep emacs does not return any results (it would also be useful to know why).

pstree -s emacs
-+= 00001 root systemd 
 \-+= 01301 chris /nix/store/3hmpbbcv1db42m9g34c9g4q6qinw50x4-systemd-237/lib/systemd/systemd --user 
   \-+= 01351 chris /nix/store/zkss82a853cv9d8w9iq25cp26q3jh4fp-emacs-25.3/bin/.emacs-wrapped --daemon 
     \--= 01414 chris /run/current-system/sw/bin/ispell -a -m -B

Solution

  • systemctl --user restart emacs