commit e165ec89dbe09379778f49ce936e44540c75560f parent aa0aba3819f4df5b37e8321ad970893a710e1d1e Author: Vincent Demeester <vincent@sbr.pm> Date: Tue, 28 Aug 2018 11:38:40 +0200 Start emacs daemon with systemd.user (at start of the session) Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | emacs.nix | | | 30 | ++++++++++++++++++++++++++++++ |
1 file changed, 30 insertions(+), 0 deletions(-)
diff --git a/emacs.nix b/emacs.nix @@ -2,6 +2,36 @@ { home.packages = with pkgs; [ emacs-scripts ]; + systemd.user.services.emacs = { + Unit = { + Description = "Emacs: the extensible, self-documenting text editor"; + }; + Service = { + Environment = "PATH=/home/vincent/.local/npm/bin:/run/wrappers/bin:/etc/profiles/per-user/vincent/bin:${config.home.profileDirectory}/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"; + Type = "forking"; + ExecStart = "/home/vincent/.nix-profile/bin/emacs --daemon"; + ExecStop = "/home/vincent/.nix-profile/bin/emacsclient --eval (kill-emacs)"; + Restart = "always"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + }; + systemd.user.services.emacs-org = { + Unit = { + Description = "Emacs: the extensible, self-documenting text editor"; + }; + Service = { + Environment = "PATH=/home/vincent/.local/npm/bin:/run/wrappers/bin:/etc/profiles/per-user/vincent/bin:${config.home.profileDirectory}/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"; + Type = "forking"; + ExecStart = "/home/vincent/.nix-profile/bin/emacs --daemon=org"; + ExecStop = "/home/vincent/.nix-profile/bin/emacsclient --socket-name=org --eval (kill-emacs)"; + Restart = "always"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + }; programs.emacs = { enable = true; # package = pkgs.myEmacs;