unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Ekaitz Zarraga <ekaitz@elenq.tech>
To: excalamus@tutanota.com
Cc: Help Guix <help-guix@gnu.org>
Subject: Re: Auto-start service
Date: Fri, 09 Jul 2021 12:21:16 +0000	[thread overview]
Message-ID: <BFHFtMWwlX_7Nf5QMuWxYU54kTzn2V_lScccbF-DU6Unrj7y9_0U1LbwYsZAbStPgbU-M6rBHDHGdzI3tcswYFw_4UsdVkYSEVuigE7-mH0=@elenq.tech> (raw)
In-Reply-To: <MdsI16a--3-2@tutanota.com>


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, July 9th, 2021 at 12:28 AM, excalamus--- via <help-guix@gnu.org> wrote:

> I'm setting up the Emacs daemon following a thread on the mailing list:        https://lists.gnu.org/archive/html/help-guix/2019-11/msg00148.html. I have services.scm and init.scm defined.  I can call `shepherd -c ~/.config/shepherd/init.scm` and the service starts.  I can kill the terminal and connect a client with `emacsclient -c`.  Trouble is, I can't figure out how to start the service on boot.
>
> The config files I'm using are:
>
> ;; services.scm
>
> (define emacsd
>
>   (make <service>
>
> #:provides '(emacsd)
>
>     #:start (make-system-constructor "emacs --daemon")
>
>     #:stop (make-system-destructor "emacsclient --eval \"(kill-emacs)\"")))
>
> ;; init.scm
>
> ;;; Shepherd User Services
>
> (load "/home/ahab/.config/shepherd/services.scm")
>
> (register-services
>
>  emacsd)
>
> ;; Send shepherd into the background.
>
> (action 'shepherd 'daemonize)
>
> ;; Services to start when shepherd starts:
>
> (for-each start '(emacsd))
>
> Based on what (shepherd) Jump Start paragraph 3 says, I'm confused about why Shepard doesn't find the config files.  Is it because Shepherd starts as superuser on boot?
>
> Meanwhile, I was advised to define a service in my config.  I'm in the process of reading the documentation (really, figuring out how to set Geiser up to read the documentation) so that I can understand the relevant parts.  Is the config the generally recommended approach for Guix SD versus the $HOME/.config/shepherd directory?
>
> Surely someone else has set up an Emacs daemon service?  The linked thread mentioned this being a good idea for a cookbook recipe.  I'd be happy to contribute to that as I'm confident I'm not alone in wanting an Emacs daemon service defined.


There's a blog post in Guix's blog about this configuration:

https://guix.gnu.org/en/blog/2020/gnu-shepherd-user-services/

I remember to have followed that and I have it working. I had to activate the user-level Shepherd by hand in any file that is executed when the system is started. In my case I have it in my i3 config. You can put it in .xsession like the thread you shared suggests.

Hope this helps.

Ekaitz


  reply	other threads:[~2021-07-09 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 22:28 Auto-start service excalamus--- via
2021-07-09 12:21 ` Ekaitz Zarraga [this message]
2021-07-10  4:13   ` excalamus--- via
2021-07-09 21:03 ` jbranso
2021-07-10  4:15   ` excalamus--- via
2021-07-10 19:53   ` jbranso
2021-07-10 23:18     ` excalamus--- via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BFHFtMWwlX_7Nf5QMuWxYU54kTzn2V_lScccbF-DU6Unrj7y9_0U1LbwYsZAbStPgbU-M6rBHDHGdzI3tcswYFw_4UsdVkYSEVuigE7-mH0=@elenq.tech' \
    --to=ekaitz@elenq.tech \
    --cc=excalamus@tutanota.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).