Commit e165ec89dbe0

Vincent Demeester <vincent@sbr.pm>
2018-08-28 11:38:40
Start emacs daemon with systemd.user (at start of the session)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent aa0aba3
Changed files (1)
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;