[Nix-dev] Emacs daemon as a user systemd service in NixOS

Damien Cassou damien.cassou at gmail.com
Thu Oct 16 13:23:38 CEST 2014


On Sun, Oct 12, 2014 at 8:17 PM, Eelco Dolstra <eelco.dolstra at logicblox.com>
wrote:
> You can define user services using the option systemd.user.services,
where you
> should be able to say:
>
>   systemd.user.services.emacs = {
>     ...
>     environment.GTK_DATA_PREFIX = config.system.path;
>   };


thank you very much. Here is my service description now:

systemd.user.services.emacs = {
    description                 = "Emacs: the extensible, self-documenting
text editor";
    environment.GTK_DATA_PREFIX = config.system.path;
    environment.SSH_AUTH_SOCK   = "%t/keyring/ssh";
    environment.GTK_PATH        =
"${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0";
    serviceConfig               = {
      Type      = "forking";
      ExecStart = "${emacs-24}/bin/emacs --daemon";
      ExecStop  = "${emacs-24}/bin/emacsclient --eval (kill-emacs)";
      Restart   = "always";
    };
    wantedBy = [ "default.target" ];
};



My next problem is that DBUS_SESSION_BUS_ADDRESS is not set in this emacs
service. Do you know how I could set it?

Bonus question: would nixos be interested in this file? Should I push it in
nixpkgs/nixos/modules (or somewhere else)?

Thanks

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without losing
enthusiasm."
Winston Churchill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20141016/e2773f24/attachment.html 


More information about the nix-dev mailing list