[Unit] Description=Emacs: the extensible, self-documenting text editor [Service] Type=forking ExecStart=/bin/sh -c "emacs --daemon" ExecStop=/bin/sh -c 'emacsclient --eval "(kill-emacs)"' Environment=PATH=%h/bin:/var/setuid-wrappers:%h/.nix-profile/bin:%h/.nix-profile/sbin:%h/.nix-profile/lib/kde4/libexec:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/nix/var/nix/profiles/default/lib/kde4/libexec:/run/current-system/sw/bin:/run/current-system/sw/sbin:/run/current-system/sw/lib/kde4/libexec Restart=always [Install] WantedBy=default.target