unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: Sergiu Ivanov <sivanov@colimite.fr>
Cc: help-guix@gnu.org
Subject: Re: Defining custom services in /etc/config.scm
Date: Mon, 25 Jan 2021 09:25:10 +1100	[thread overview]
Message-ID: <87wnw2ynuh.fsf@zancanaro.id.au> (raw)
In-Reply-To: <874kj6duek.fsf@colimite.fr>

Hi Sergiu!

On Mon, Jan 25 2021, Sergiu Ivanov wrote:
> I understand that I should somehow construct a <service> (?) 
> from my <shepherd-service>, but I don't see a way to do it.

Unfortunately Guix overloads the word "service", where we have (a) 
services that consist of structured modifications to an operating 
system, and (b) shepherd services that define a process that will 
run on the resulting system. Shepherd services cannot be used 
directly, but need to be added to an instance of the 
shepherd-root-service-type service. The easiest way to do this is 
to use simple-service (documented in "(guix) Service Reference" in 
the manual).

Putting it together, this should return a service object which 
runs your redshift shepherd service:

  (simple-service 'redshift-service 'shepherd-root-service-type 
  (list redshift-service))

I hope that helps!

Carlo


  parent reply	other threads:[~2021-01-24 22:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24 19:09 Defining custom services in /etc/config.scm Sergiu Ivanov
2021-01-24 19:19 ` Ekaitz Zarraga
2021-01-24 19:59   ` Sergiu Ivanov
2021-01-24 22:25 ` Carlo Zancanaro [this message]
2021-01-25 20:50   ` Sergiu Ivanov

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=87wnw2ynuh.fsf@zancanaro.id.au \
    --to=carlo@zancanaro.id.au \
    --cc=help-guix@gnu.org \
    --cc=sivanov@colimite.fr \
    /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).