From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sJL1IYDIDWBeZQAA0tVLHw (envelope-from ) for ; Sun, 24 Jan 2021 19:20:32 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SNG5HYDIDWBKQgAAB5/wlQ (envelope-from ) for ; Sun, 24 Jan 2021 19:20:32 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 75FA094024D for ; Sun, 24 Jan 2021 19:20:31 +0000 (UTC) Received: from localhost ([::1]:36218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3kw1-0005Ez-VD for larch@yhetil.org; Sun, 24 Jan 2021 14:20:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3kvU-0005Es-N7 for help-guix@gnu.org; Sun, 24 Jan 2021 14:19:56 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:38632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3kvP-0006x1-3J for help-guix@gnu.org; Sun, 24 Jan 2021 14:19:56 -0500 Date: Sun, 24 Jan 2021 19:19:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail3; t=1611515988; bh=rrg+kByamKFL/EU/ecXdLvHg3+Pu1aC43nbhOC+yPzM=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=YJhquey4+unr3+y9dvzVg3GbD4WpEB+mlzbxqUe0qXx1et5ExDhSN/J8AhGDZgWJq zAi0NJ586i6disXqqBJBFnS426DCI+3CSIzhIut1gZYQSxCmmJEoRYy1qAc4wrD6wn zqO2aKvRYHgt+JQhfot1IkBphUsDpjsPZOvrp5/xyAc70wyRUrPAkGIY6JZYqa0EXu fcHDcXgEAGXwmVCpJ5yv9n3K6+pny0kg43A95i6UsVCYh4TjF9/t5P3FgrsxJvI1hS J5eAaJuH58QYxt9scLWtOoixQPzqYGBlV//L/jTBsWvwE2x8qSAF1bcS0CMMJjku/W 4vDd6+ZoUsBog== To: Sergiu Ivanov , "help-guix\\@gnu.org" From: Ekaitz Zarraga Subject: Re: Defining custom services in /etc/config.scm Message-ID: In-Reply-To: <874kj6duek.fsf@colimite.fr> References: <874kj6duek.fsf@colimite.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.134; envelope-from=ekaitz@elenq.tech; helo=mail-40134.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Ekaitz Zarraga Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.05 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=elenq.tech header.s=protonmail3 header.b=YJhquey4; dmarc=pass (policy=none) header.from=elenq.tech; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 75FA094024D X-Spam-Score: -3.05 X-Migadu-Scanner: scn0.migadu.com X-TUID: Aodo31tNGjAC =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Sunday, January 24, 2021 8:09 PM, Sergiu Ivanov wr= ote: > 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 #< ...". > > I understand that I should somehow construct a (?) from my > , 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