unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Ekaitz Zarraga <ekaitz@elenq.tech>
To: Sergiu Ivanov <sivanov@colimite.fr>,
	"help-guix\\@gnu.org" <help-guix@gnu.org>
Subject: Re: Defining custom services in /etc/config.scm
Date: Sun, 24 Jan 2021 19:19:45 +0000	[thread overview]
Message-ID: <JRk3ZXh-DQLIN7gyEoDNX_g5ULD2i7aaWXeotgEG2BHthfV3Qf6t6IVk7mQVaboBcPqkBOvv7KeJbK6VTHumfTUuCbHtHt2Iog40ym-XqNQ=@elenq.tech> (raw)
In-Reply-To: <874kj6duek.fsf@colimite.fr>



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, January 24, 2021 8:09 PM, Sergiu Ivanov <sivanov@colimite.fr> wrote:

> Hello,
>
> I'm trying to start redshift [0] as a shepherd service, and this is how
> I defined the redshift service in my /etc/config.scm:
>
> (define evry-geolocation "48.63681:2.42777")
> (define redshift-service
> (shepherd-service
> (provision '(redshift))
> (requirement '(xorg-server))
> (documentation "Start Redshift as a service")
> (start #~(make-forkexec-constructor
> `("redshift" "-l" ,evry-geolocation)))
> (stop #~(make-kill-destructor))))
>
> However, I can't find a way to add this to the services field of the
> operating-system declaration.
>
> When I try:
>
> (services (append
> (list redshift-service
> (service xfce-desktop-service-type)
> (set-xorg-configuration
> (xorg-configuration (keyboard-layout keyboard-layout))))
> %desktop-services))
>
> I get the message "Wrong type argument #<<shepherd-service> ...".
>
> I understand that I should somehow construct a <service> (?) from my
> <shepherd-service>, but I don't see a way to do it.
>
> I've also seen a couple mailing list discussions [1,2] and a blog post
> [3] about doing what I want in "pure shepherd", i.e. independently of
> Guix, but these solutions seem to be doing more than what I need.
>
> How can I add a custom shepherd service to the operating-system
> definition in /etc/config.scm?
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Sergiu
>
> [0] http://jonls.dk/redshift/
> [1] https://lists.gnu.org/archive/html/guix-devel/2018-02/msg00047.html
> [2] https://www.mail-archive.com/guix-devel@gnu.org/msg46278.html
> [3] https://guix.gnu.org/blog/2020/gnu-shepherd-user-services/





Hi Sergiu,

I recently made my redshift configuration using shepherd user
services, which is what people in IRC recommended me.

You can find it here:
https://github.com/ekaitz-zarraga/dotfiles/tree/guix/shepherd/shepherd

Also, it forces me to run the shepherd as a user using my i3 config.

I also wanted to configure it in my config.scm file but people
convinced me not to do so.

I'm not sure why your case shouldn't work though.

Best,
Ekaitz


  reply	other threads:[~2021-01-24 19:20 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 [this message]
2021-01-24 19:59   ` Sergiu Ivanov
2021-01-24 22:25 ` Carlo Zancanaro
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='JRk3ZXh-DQLIN7gyEoDNX_g5ULD2i7aaWXeotgEG2BHthfV3Qf6t6IVk7mQVaboBcPqkBOvv7KeJbK6VTHumfTUuCbHtHt2Iog40ym-XqNQ=@elenq.tech' \
    --to=ekaitz@elenq.tech \
    --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).