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 ms0.migadu.com with LMTPS id cJ98LdPvTWGFbQAAgWs5BA (envelope-from ) for ; Fri, 24 Sep 2021 17:33:39 +0200 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 4DFCKdPvTWE3LwAA1q6Kng (envelope-from ) for ; Fri, 24 Sep 2021 15:33:39 +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 496AA34B09 for ; Fri, 24 Sep 2021 17:33:39 +0200 (CEST) Received: from localhost ([::1]:57524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTnCj-0003SI-TY for larch@yhetil.org; Fri, 24 Sep 2021 11:33:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTnCT-0003QE-F2 for guix-devel@gnu.org; Fri, 24 Sep 2021 11:33:21 -0400 Received: from mx1.dismail.de ([78.46.223.134]:29248) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTnCB-0004NC-Jz; Fri, 24 Sep 2021 11:33:20 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 52ec8598; Fri, 24 Sep 2021 17:32:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=20190914; bh=S8CNI3xl QPgH8S/00mmIz3+CSS/wmNtbQTXZzrerpaY=; b=E1P2pTA1RSmacWDY4yqfpO+/ xVi+9+llL/Idz3xgHupNIhpynCioOB4s1/EjKC2rGyjtHq+mZnLXHQ83USBVtRm9 WRTd9iI+W66VO6BD0N2m0PszBXApTBXqEeiZjKrsaGNddd+iVLwSRmtZMQ8gMtxt +42sbV7F6u4LLInWOxuUcYLBR9DcF3gum549T+opmM+CfCoepCInbyh3qcLSxwuC N9dmSBh0BD7BhN4WAuO5+fzJoPw9XVmMwSQmjCLzHxVIP7cpIr/ACL/zFqnRJUVq ZcsJt4nbmjT4MO/KCNp/xUTob6799POIbtZCZRY44ERsUHfLnDkjptqw60fPNA== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 63bdf9f3; Fri, 24 Sep 2021 17:32:59 +0200 (CEST) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id 385c614a; Fri, 24 Sep 2021 17:32:59 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 67986aa5 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 24 Sep 2021 17:32:58 +0200 (CEST) From: Joshua Branson To: Xinglu Chen Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , guix-devel@gnu.org, Maxim Cournoyer , Andrew Tropin Subject: Re: Code sharing between system and home services (was Re: On the naming of System and Home services modules.) References: <87tuiajdv1.fsf@yoctocell.xyz> Mail-Followup-To: Xinglu Chen , Ludovic =?utf-8?Q?Co?= =?utf-8?Q?urt=C3=A8s?= , guix-devel@gnu.org, Maxim Cournoyer , Andrew Tropin Date: Fri, 24 Sep 2021 11:32:55 -0400 In-Reply-To: <87tuiajdv1.fsf@yoctocell.xyz> (Xinglu Chen's message of "Fri, 24 Sep 2021 15:35:14 +0200") Message-ID: <87a6k2ng48.fsf@dismail.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=78.46.223.134; envelope-from=jbranso@dismail.de; helo=mx1.dismail.de 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632497619; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=+dhYchfQF2K32oC03gbFXV5L/OW4znGKcgIEe5FUt4s=; b=RsvbaKkOcqs18ch+V/8AHm4dlxFww6L3/0Wry7uWXbCebIGEgqNdkgYUvX+SnbICpVzQyP UA0XcS44J7e3I6j7I+x2ILP01NOuS57XAwsRw5yMfLXuAVK33RbDqejT1Oa4pEVkZwlRYv HOEKMsxgZXr06gEx/u5shm2cWPg0KD3ymdkBzFeg5SDazbp62/S18SQ9up23/hNdrT3vCK F/5lYAjeom3r8s0tgYCay3H5LCQmUEFpLV4+WLfbtCtZ5DJRIrxYXLSV334zRsdehxZchk +sWqJPWjomCRW7o7d67PLu5NS0H06tUhl8lIMW0rQGf9NCgzDGiwACYnnEkvXw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632497619; a=rsa-sha256; cv=none; b=c1TvlD1ZgcWXMtybrVOw13X3HzTnl29W4UuMic5l22LgirGkElw5R059jFxyxTqkAVGmom O2YYfO03auNY1CAlfrZy2/2OJXhnlfhiykDUNqTAxEMgZxq50w7zoWXZvy9xupLXC4b6Qb KnXu746dM2Ob0ZwcYqzyy3+qjo8glP0taW6m+ZJk1w5FCrgGAIXxOs3bELT+wdL2KU040Y 6RXdnatp2jMOJqaIVOsrjl9XPb/9ym49KX4SDe1IJ1A2hebGLlpKRFAFZd5bRmyWKeNnAP GvVCfl6HIA2HD1EOHKLLj/BanKVAYarY0H4BvcWi35xm7pF/PwCX9W7p8witGg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b=E1P2pTA1; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -3.59 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=dismail.de header.s=20190914 header.b=E1P2pTA1; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 496AA34B09 X-Spam-Score: -3.59 X-Migadu-Scanner: scn1.migadu.com X-TUID: /rg8B5KFvU2C Xinglu Chen writes: > On Thu, Sep 23 2021, Ludovic Court=C3=A8s wrote: > >> Hi, >> >> Xinglu Chen skribis: >> >>> Some services might be useful to have in both Guix System and Guix Home; >>> for instance, Guix System currently has a service for configuring >>> Syncthing, and I think it makes sense to also have one for Guix Home, >>> this would mean that people not using Guix System (me :-)) could also >>> have Guix manage Syncthing. With the current approach, we would have to >>> copy and paste quite a bit of code, and if the Syncthing service for >>> Guix System changes, then the one for Guix Home might have to change as >>> well. >> >> Silly question, but why do we need to have two different configuration >> record types in the first place? > > The problem is that the configuration records for system and home > service don=E2=80=99t necessarily have the same fields. The Syncthing se= rvice > for Guix System has a =E2=80=98user=E2=80=99 and a =E2=80=98group=E2=80= =99 field, which is not really of > any use in Guix Home, as the only user would be the user invoking =E2=80= =98guix > home=E2=80=99. Apologies if I'm speaking for something I know very little about...Wouldn't it be nice if guix home services would accept a user and a group field? For the syncthing service, perhaps the user wants to limit Syncthing's runtime permissions. So instead of running as the user, the user would run synthing as a different user with less permissions? Please note it may be much better to just container-ize the synthing service. Does guix home have that ability? https://guix.gnu.org/en/blog/2017/running-system-services-in-containers/ > >> Sharing configuration between Home and System sounds important to me: it >> means users can easily move services from one to the other, which is >> pretty big deal. It also means we=E2=80=99d have much less code to main= tain. > > Agreed, that=E2=80=99s what I would like to see as well. > >> Would that be feasible? (Apologies if this has already been >> discussed!) > > Since it might not make sense to have the same records fields for a > system service and home service, I proposed (in the mail you replied to) > a =E2=80=98define-configuration=E2=80=99 form that would generate a confi= guration record > for a system service and optionally one for a home service, without > having to maintain two records separately. > > (define-configuration syncthing-configuration > (package > (package syncthing) > "Syncthing package to use.") > (arguments > (list-of-strings =E2=80=99()) > "Command line arguments to pass to the Syncthing package.") > (log-flags > (integer 0) > "Sum of logging flags.") > (user > (maybe-string 'disabled) > "The user as which the Syncthing service is to be run." > (home-service? #f)) ; not for Guix Home > (group > (string "users") > "The group as which the Syncthing service is to be run." > (home-service? #f)) ; likewise ^^ > (home > (maybe-string 'disabled) > "Common configuration and data directory.") > (home-service? #t)) > > It would generate and > . The only difference being that > doesn=E2=80=99t have a =E2=80=98user=E2=80= =99 and a =E2=80=98group=E2=80=99 > field. > > It=E2=80=99s probably going to be quite complicated, so it would be good = to get > some feedback/thoughts on it. Cc Maxim since he has done some work with > (gnu services configuration). > > Also, it=E2=80=99s probably time to properly document (gnu services > configuration) in the manual. ;-) > >> Also, I proposed earlier a possible way to generate a Home service type >> from the corresponding System service type=E2=80=94or, IOW, to generate = a Home >> service type graph from the System graph. Does that sound feasible? > > I am not sure exactly what you mean here, could you elaborate? > --=20 Joshua Branson (jab in #guix) Sent from Emacs and Gnus https://gnucode.me https://video.hardlimit.com/accounts/joshua_branson/video-channels https://propernaming.org "You can have whatever you want, as long as you help enough other people get what they want." - Zig Ziglar =20=20