From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wO7kEUcvD2D5LwAA0tVLHw (envelope-from ) for ; Mon, 25 Jan 2021 20:51:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gPvLDUcvD2AKKgAA1q6Kng (envelope-from ) for ; Mon, 25 Jan 2021 20:51:19 +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 B3DC9940275 for ; Mon, 25 Jan 2021 20:51:15 +0000 (UTC) Received: from localhost ([::1]:60960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l48pN-0000jQ-Eb for larch@yhetil.org; Mon, 25 Jan 2021 15:51:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l48pE-0000j5-3E for help-guix@gnu.org; Mon, 25 Jan 2021 15:51:04 -0500 Received: from marvid.fr ([163.172.81.107]:48024 helo=courriel.marvid.fr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l48pC-0005Hm-52 for help-guix@gnu.org; Mon, 25 Jan 2021 15:51:03 -0500 Received: from localhost (schwifty.marvid.fr [51.159.4.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by sahkopoika (Postfix) with ESMTPSA id 1FD5B4809ACD; Mon, 25 Jan 2021 21:50:52 +0100 (CET) References: <874kj6duek.fsf@colimite.fr> <87wnw2ynuh.fsf@zancanaro.id.au> User-agent: mu4e 1.4.13; emacs 27.1 From: Sergiu Ivanov To: Carlo Zancanaro Subject: Re: Defining custom services in /etc/config.scm In-reply-to: <87wnw2ynuh.fsf@zancanaro.id.au> Date: Mon, 25 Jan 2021 21:50:51 +0100 Message-ID: <87im7kbv10.fsf@colimite.fr> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: none client-ip=163.172.81.107; envelope-from=sivanov@colimite.fr; helo=courriel.marvid.fr X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, FORGED_SPF_HELO=1, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=no 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: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.35 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: B3DC9940275 X-Spam-Score: -2.35 X-Migadu-Scanner: scn0.migadu.com X-TUID: BDYqVs+XKxEx Hi Carlo, Thanks a lot for your answer ! Thus quoth Carlo Zancanaro on Sun Jan 24 2021 at 23:25 (+0100): > On Mon, Jan 25 2021, Sergiu Ivanov wrote: >> I understand that I should somehow construct a (?) from my >> , 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. A-ha, OK, I vaguely felt this distinction, but I wasn't sure. > 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! This helped indeed: my redshift-service got integrated into the system service tree. You solved my frustration: I thought I understood almost everything I needed from the documentation, but I couldn't put the pieces together. Invoking simple-service in this way made the pieces click; I'm happy. Still, I'll go with Shepherd user services: https://guix.gnu.org/blog/2020/gnu-shepherd-user-services/ Running redshift as a system service, even as my user, prevents it from easily detecting my X session. Also, I realized that I could even run mcron as a user service, which actually makes several things somewhat easier. I initially hoped to cram as much as I could into /etc/config.scm (in particular because guix-home-manager looks a lot less evolved than Nix's home-manager (and that's an opportunity to contribute, but I need to get a better grasp on Guix first)), but after all having a couple user files written in Guile is not a big issue, because the uniformity of the configuration language is more important for me. - Sergiu