From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 23 04:10:38 2023 Received: (at submit) by debbugs.gnu.org; 23 Mar 2023 08:10:38 +0000 Received: from localhost ([127.0.0.1]:37261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfG1t-0004iX-N2 for submit@debbugs.gnu.org; Thu, 23 Mar 2023 04:10:38 -0400 Received: from lists.gnu.org ([209.51.188.17]:35538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfG1r-0004iP-KX for submit@debbugs.gnu.org; Thu, 23 Mar 2023 04:10:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfG1r-000817-3c for guix-patches@gnu.org; Thu, 23 Mar 2023 04:10:35 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pfG1o-0000jC-I9 for guix-patches@gnu.org; Thu, 23 Mar 2023 04:10:34 -0400 Received: by mail-ed1-x52b.google.com with SMTP id x3so82888777edb.10 for ; Thu, 23 Mar 2023 01:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1679559029; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IC55tM44snyqJ+/ijujM4DRcjwXenZd2T/6a7bB1b9Q=; b=jSBw9mmmnJzXcYe59ENK4PvkiQ783HTBCxYiFFXayfMFgmofSgNE6aol+WlxxmXNDZ t/IuF0derBP5EO/poSNdhyuB19+iFbI1CkvcG9Pd4ui7ZSryh8C0y3agBikwsWFtoZw0 7soEb66gTt5tlQpuoAZVMN7L7/1qRiOSFbxvQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679559029; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IC55tM44snyqJ+/ijujM4DRcjwXenZd2T/6a7bB1b9Q=; b=mMHib1Yc2saSV1WUIWoqHAxUIkd9Om9S5jfQQz8gGiPwE+sk0MzYUjO+Pr2PtEUVdq hy962ccV1Ax9hO9jysYrXGe77LdnpshPj+bhsRyvgEfUCWypnsSqqhWwwLiEo25D0e6a 3ISLFp7/++yUftUglMP3ZGKh/1ZrML167PrQFXXWXxt8ujdB6nEYO1QBkFXOAUh/DlLG ARg4hv3LLFPnWvjzMN/hYwxOFOaigfydi+FQNEijh1T0NBqma1butwHhMpEPfyViqe90 wno+o/lp4bioQEKDUWhrZ3iiIlrQ1tB/KBY+g/hLPWHFn+Rl6Rctp9f56Udz2wwxrp/L jPWQ== X-Gm-Message-State: AO0yUKWuUQb5kk2r6S+P3TuCWWnDchfdDZzr1NLvU3EOZvaWbnmLGBnx aGIc9r0lKMU87oi9PcE0g9EAJlPm+FT+TvSeb9M= X-Google-Smtp-Source: AK7set/Ircpz9aM6aLc2nuc8voKJh6EBrTbEdVymTCXJkuaBPI+2PnAD6EYGGwO51mE4KRBvAtPZfA== X-Received: by 2002:a17:906:580c:b0:933:3aa7:57a7 with SMTP id m12-20020a170906580c00b009333aa757a7mr9232455ejq.49.1679559029378; Thu, 23 Mar 2023 01:10:29 -0700 (PDT) Received: from localhost ([95.168.147.255]) by smtp.gmail.com with ESMTPSA id e3-20020a170906504300b00930c6c01c9esm8498224ejk.143.2023.03.23.01.10.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 01:10:29 -0700 (PDT) From: Sergey Trofimov To: guix-patches@gnu.org Subject: [PATCH] home: Add home-syncthing-service-type. Date: Thu, 23 Mar 2023 09:10:26 +0100 Message-Id: <20230323081026.13850-1-sarg@sarg.org.ru> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Debbugs-Cc: paren@disroot.org, andrew@trop.in, ludo@gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=2a00:1450:4864:20::52b; envelope-from=sarg@sarg.org.ru; helo=mail-ed1-x52b.google.com 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Sergey Trofimov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/home/services/syncthing.scm (home-syncthing-service-type): New variable. (home-syncthing-configuration): New procedure. * gnu/services/syncthing.scm (syncthing-shepherd-service): Adapt to be used as a home service. * doc/guix.texi: Ditto. --- doc/guix.texi | 42 ++++++++++++++++++++++++++++- gnu/home/services/syncthing.scm | 48 +++++++++++++++++++++++++++++++++ gnu/services/syncthing.scm | 15 +++++++---- 3 files changed, 99 insertions(+), 6 deletions(-) create mode 100644 gnu/home/services/syncthing.scm diff --git a/doc/guix.texi b/doc/guix.texi index dfdb26103a..a2fe2514db 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20735,7 +20735,7 @@ List of command-line arguments passing to @code{syncthing} binary. Sum of logging flags, see @uref{https://docs.syncthing.net/users/syncthing.html#cmdoption-logflags, Syncthing documentation logflags}. -@item @code{user} (default: @var{#f}) +@item @code{user} The user as which the Syncthing service is to be run. This assumes that the specified user exists. @@ -41790,6 +41790,7 @@ services)}. * Sound: Sound Home Services. Dealing with audio. * Messaging: Messaging Home Services. Services for managing messaging. * Media: Media Home Services. Services for managing media. +* Networking: Networking Home Services. @end menu @c In addition to that Home Services can provide @@ -42978,6 +42979,45 @@ kodi} for more information. @end table @end deftp +@node Networking Home Services +@subsection Networking Home Services + +@cindex syncthing +With the @code{(gnu home services syncthing)} service, you can configure +@uref{https://github.com/syncthing/syncthing, Syncthing} to run upon +login. + +Here is an example of a service and its configuration that you could add +to the @code{services} field of your @code{home-environment}: + +@lisp +(service home-syncthing-service-type + (home-syncthing-configuration + (arguments '("--paused")))) +@end lisp + +@defvar home-syncthing-service-type +This is the type of the @code{syncthing} home service, whose value is an +@code{home-syncthing-configuration} object. +@end defvar + +@deftp {Data Type} home-syncthing-configuration +Data type representing the configuration for @code{home-syncthing-service-type}. + +@table @asis +@item @code{syncthing} (default: @var{syncthing}) +@code{syncthing} package to use. + +@item @code{arguments} (default: @var{'()}) +List of command-line arguments passing to @code{syncthing} binary. + +@item @code{logflags} (default: @var{0}) +Sum of logging flags, see +@uref{https://docs.syncthing.net/users/syncthing.html#cmdoption-logflags, Syncthing documentation logflags}. + +@end table +@end deftp + @node Invoking guix home @section Invoking @command{guix home} diff --git a/gnu/home/services/syncthing.scm b/gnu/home/services/syncthing.scm new file mode 100644 index 0000000000..928a23986b --- /dev/null +++ b/gnu/home/services/syncthing.scm @@ -0,0 +1,48 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Oleg Pykhalov +;;; Copyright © 2023 Sergey Trofimov +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu home services syncthing) + #:use-module (gnu services) + #:use-module (gnu services syncthing) + #:use-module (gnu services shepherd) + #:use-module (gnu home services shepherd) + + #:export (home-syncthing-service-type + home-syncthing-configuration)) + +(define syncthing-home-shepherd-service + (lambda (configuration) + (map (lambda (srv) (shepherd-service (inherit srv) (requirement '()))) + ((@@ (gnu services syncthing) syncthing-shepherd-service) configuration)))) + +(define-syntax-rule (home-syncthing-configuration args ...) + (syncthing-configuration + (user #f) + args ...)) + +(define home-syncthing-service-type + (service-type (name 'syncthing) + (extensions (list (service-extension home-shepherd-service-type + syncthing-home-shepherd-service))) + (default-value (home-syncthing-configuration)) + (description + "Run @uref{https://github.com/syncthing/syncthing, Syncthing} +decentralized continuous file system synchronization."))) + +;;; syncthing.scm ends here diff --git a/gnu/services/syncthing.scm b/gnu/services/syncthing.scm index 7c3d5b027d..960f0a1db8 100644 --- a/gnu/services/syncthing.scm +++ b/gnu/services/syncthing.scm @@ -43,8 +43,7 @@ (define-record-type* (default '())) (logflags syncthing-configuration-logflags ;number (default 0)) - (user syncthing-configuration-user ;string - (default #f)) + (user syncthing-configuration-user) ;string (group syncthing-configuration-group ;string (default "users")) (home syncthing-configuration-home ;string @@ -55,9 +54,12 @@ (define syncthing-shepherd-service (($ syncthing arguments logflags user group home) (list (shepherd-service - (provision (list (string->symbol (string-append "syncthing-" user)))) + (provision (list + (or (and user (string->symbol (string-append "syncthing-" user))) + 'syncthing))) (documentation "Run syncthing.") (requirement '(loopback)) + (modules '((srfi srfi-1) (shepherd support))) (start #~(make-forkexec-constructor (append (list (string-append #$syncthing "/bin/syncthing") "-no-browser" @@ -65,9 +67,12 @@ (define syncthing-shepherd-service (string-append "-logflags=" (number->string #$logflags))) '#$arguments) #:user #$user - #:group #$group + #:group (and #$user #$group) #:environment-variables - (append (list (string-append "HOME=" (or #$home (passwd:dir (getpw #$user)))) + (append (list (string-append "HOME=" + (or #$home + (and #$user (passwd:dir (getpw #$user))) + user-homedir)) "SSL_CERT_DIR=/etc/ssl/certs" "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt") (remove (lambda (str) -- 2.39.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 28 11:58:29 2023 Received: (at 62401) by debbugs.gnu.org; 28 Mar 2023 15:58:30 +0000 Received: from localhost ([127.0.0.1]:50550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phBiP-0005CG-Lb for submit@debbugs.gnu.org; Tue, 28 Mar 2023 11:58:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phBiN-0005C1-Eb for 62401@debbugs.gnu.org; Tue, 28 Mar 2023 11:58:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phBiF-00035g-4a; Tue, 28 Mar 2023 11:58:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=gUBdIJTYa7KP0OLy4eKSmg7ppaiQXVxMLrR+iKgymV8=; b=Z1ptId2XHM+6hZR5LpOA 2zUDYIsMH0t0tDSyHmwpPg6JoxgrSrslCeKZjV9mTfBFita42LuIE5ntN7k9Yqw5akBIfqkuSaUQO 28AwyTCecWvGr5vpJxyZBrn47W2nUolkB44VrsI9KkGGUcENtmkoSvWya2wUTM1rAlhra58fWPjsz RiIWTsfSEWrmvff9+2bty+jsMZm2lm3J+JnurHeT2DPLxe+r3coVcyv6Of6g0tSmX8AZ/JERDsI+6 ZRZYVX3As8WUZjRos0c/7RwrS8x+UR1XivozRPjI8ToBpmzAhATwG6fDgoRB2Vf3HMRb3lEXRPyQS ZAjGDzRW6etTmg==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phBiD-0005ZX-M9; Tue, 28 Mar 2023 11:58:18 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Sergey Trofimov Subject: Re: [bug#62401] [PATCH] home: Add home-syncthing-service-type. References: <20230323081026.13850-1-sarg@sarg.org.ru> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Octidi 8 Germinal an 231 de la =?utf-8?Q?R=C3=A9volu?= =?utf-8?Q?tion=2C?= jour de la Jonquille X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 28 Mar 2023 17:58:15 +0200 In-Reply-To: <20230323081026.13850-1-sarg@sarg.org.ru> (Sergey Trofimov's message of "Thu, 23 Mar 2023 09:10:26 +0100") Message-ID: <87o7ocg960.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62401 Cc: paren@disroot.org, 62401@debbugs.gnu.org, andrew@trop.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Sergey Trofimov skribis: > * gnu/home/services/syncthing.scm > (home-syncthing-service-type): New variable. > (home-syncthing-configuration): New procedure. > * gnu/services/syncthing.scm > (syncthing-shepherd-service): Adapt to be used as a home service. > * doc/guix.texi: Ditto. Nice! Note: You can just say =E2=80=9CNew file=E2=80=9D for a new file; however p= lease specify the name of the node added to the manual, for clarity. > +(define syncthing-home-shepherd-service > + (lambda (configuration) > + (map (lambda (srv) (shepherd-service (inherit srv) (requirement '())= )) > + ((@@ (gnu services syncthing) syncthing-shepherd-service) confi= guration)))) You could do that without resorting to @@, by using =E2=80=98find=E2=80=99 = on the extensions of =E2=80=98syncthing-service-type=E2=80=99. > diff --git a/gnu/services/syncthing.scm b/gnu/services/syncthing.scm > index 7c3d5b027d..960f0a1db8 100644 > --- a/gnu/services/syncthing.scm > +++ b/gnu/services/syncthing.scm > @@ -43,8 +43,7 @@ (define-record-type* > (default '())) > (logflags syncthing-configuration-logflags ;number > (default 0)) > - (user syncthing-configuration-user ;string > - (default #f)) > + (user syncthing-configuration-user) ;string This means that users of =E2=80=98syncthing-service-type=E2=80=99 will now = have to provide a value for =E2=80=98user=E2=80=99, which wasn=E2=80=99t the case u= ntil now. Is this change necessary? The rest looks reasonable to me. My main concern is whether it would make sense to automate system->home service translation. I=E2=80=99ll expa= nd on that separately. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 28 12:18:33 2023 Received: (at 62401) by debbugs.gnu.org; 28 Mar 2023 16:18:34 +0000 Received: from localhost ([127.0.0.1]:50568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phC1p-0005ic-Cb for submit@debbugs.gnu.org; Tue, 28 Mar 2023 12:18:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phC1n-0005iQ-RB for 62401@debbugs.gnu.org; Tue, 28 Mar 2023 12:18:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phC1f-00089Y-P9; Tue, 28 Mar 2023 12:18:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=CjzggzOy8FsRmwtlGczw4QJU8xOcXnQPsd0boz97y0M=; b=pjs+1HO7OlwY8pgJ4Jh6 wxTg0+hg2ASsJsTtgypR0isaPjfDvR0WytT0uoB87WdrgboRmQ/K9Xesdni9AT8pGBxFLPotpKZ46 C6I93gHycJCsWijSxI8/K83AhuyKnwfRA0tyPTEfUGkYreIHdk6EvcBbfLMXlTIBj7fvYC9TN+552 Fh6f2z6usNLad8aE9bmJWjqD6yR2UT8RnR4P5kayl0hoY0w8MqalgNBfWd4yhDA9+0IMRRpIpx8hs 4k8Sl2N53xoALXkkLwcrgF9il0naZ75rqBjWAwrOYOefeYCrP3uRA9emm9ohHmJQ+jYtHngTrPIjw rUANP2/qOSTjkQ==; Received: from [193.50.110.81] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phC1f-0008Ow-1d; Tue, 28 Mar 2023 12:18:23 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Sergey Trofimov Subject: Automatically mapping services from System to Home References: <20230323081026.13850-1-sarg@sarg.org.ru> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Octidi 8 Germinal an 231 de la =?utf-8?Q?R=C3=A9volu?= =?utf-8?Q?tion=2C?= jour de la Jonquille X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 28 Mar 2023 18:18:20 +0200 In-Reply-To: <20230323081026.13850-1-sarg@sarg.org.ru> (Sergey Trofimov's message of "Thu, 23 Mar 2023 09:10:26 +0100") Message-ID: <87edp8g88j.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62401 Cc: guix-devel@gnu.org, paren@disroot.org, 62401@debbugs.gnu.org, andrew@trop.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable One idea I toyed with is automatic translation of service types from System to Home. The service itself would look like this: --8<---------------cut here---------------start------------->8--- (define-module (gnu home services syncthing) #:use-module (gnu home services) #:use-module (gnu services syncthing) #:export (home-syncthing-service-type) #:re-export (syncthing-configuration syncthing-configuration?)) (define home-syncthing-service-type (system-service-type->home-service-type syncthing-service-type)) --8<---------------cut here---------------end--------------->8--- The code to do that is attached below. The key here is that we=E2=80=99d d= efine mappings, like: (define-service-type-mapping shepherd-root-service-type =3D> home-shepherd-service-type) The rest of the service type graph would be automatically constructed from this. I feel like it would be worth pursuing this path so that there=E2=80=99s as little duplication as possible between Home and System. OTOH, it doesn=E2=80=99t take care of things like #:user in =E2=80=98make-forkexec-constructor=E2=80=99 calls and the like. Thoughts? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/gnu/home/services.scm b/gnu/home/services.scm index b7ea6f08dd..b32e7395b1 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2021 Andrew Tropin ;;; Copyright =C2=A9 2021 Xinglu Chen +;;; Copyright =C2=A9 2022 Ludovic Court=C3=A8s ;;; ;;; This file is part of GNU Guix. ;;; @@ -31,8 +32,10 @@ (define-module (gnu home services) #:use-module (guix diagnostics) #:use-module (guix i18n) #:use-module (guix modules) + #:use-module (guix memoization) #:use-module (srfi srfi-1) #:use-module (ice-9 match) + #:use-module (ice-9 vlist) =20 #:export (home-service-type home-profile-service-type @@ -46,6 +49,9 @@ (define-module (gnu home services) fold-home-service-types home-provenance =20 + define-service-type-mapping + system-service-type->home-service-type + %initialize-gettext) =20 #:re-export (service @@ -396,6 +402,77 @@ (define home-activation-service-type reconfiguration or generation switching. This service can be extended with one gexp, but many times, and all gexps must be idempotent."))) =20 + +;;; +;;; Service type graph rewriting. +;;; + +(define (service-type-mapping proc) + (define (rewrite extension) + (match (proc (service-extension-target extension)) + (#f #f) + (target + (service-extension target + (service-extension-compute extension))))) + + (define replace + (mlambdaq (type) + (service-type + (inherit type) + (location (service-type-location type)) + (extensions (filter-map rewrite (service-type-extensions type)))))) + + replace) + +;; (define (service-type-extensions-rewriting replacements) +;; (define replace +;; (let ((replacements (alist->vhash replacements hashq))) +;; (lambda (type) +;; (match (vhash-assq type replacements) +;; (#f type) +;; ((_ . replacement) replacement))))) + +;; (service-type-mapping replace)) + +(define system-service-type->home-service-type + (let () + (define (replace type) + (define replacement + (hashq-ref %system/home-service-type-mapping type + *unspecified*)) + + (if (eq? replacement *unspecified*) + type + replacement)) + + (service-type-mapping replace))) + +(define %system/home-service-type-mapping + (make-hash-table)) + +(define-syntax define-service-type-mapping + (syntax-rules (=3D>) + ((_ system-type =3D> home-type) + (hashq-set! %system/home-service-type-mapping + system-type home-type)))) + +(define-syntax define-service-type-mappings + (syntax-rules (=3D>) + ((_ (system-type =3D> home-type) ...) + (begin + (define-service-type-mapping system-type =3D> home-type) + ...)))) + +(define-service-type-mappings + (system-service-type =3D> home-service-type) + (activation-service-type =3D> home-activation-service-type)) + +;; (define system->home-service-type +;; (service-type-extensions-rewriting +;; `((,system-service-type . ,home-service-type) +;; (,activation-service-type . ,home-activation-service-type) +;; (,shepherd-root-service-type . ,home-shepherd-service-type)))) + ;;; ;;; On-change. diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm index 7a9cc064bb..21b73d8cdf 100644 --- a/gnu/home/services/shepherd.scm +++ b/gnu/home/services/shepherd.scm @@ -131,4 +131,5 @@ (define-public home-shepherd-service-type (default-value (home-shepherd-configuration)) (description "Configure and install userland Shepherd."))) =20 - +(define-service-type-mapping + shepherd-root-service-type =3D> home-shepherd-service-type) diff --git a/gnu/services/syncthing.scm b/gnu/services/syncthing.scm index 7c3d5b027d..130a87705e 100644 --- a/gnu/services/syncthing.scm +++ b/gnu/services/syncthing.scm @@ -57,7 +57,7 @@ (define syncthing-shepherd-service (shepherd-service (provision (list (string->symbol (string-append "syncthing-" user))= )) (documentation "Run syncthing.") - (requirement '(loopback)) + ;; (requirement '(loopback)) (start #~(make-forkexec-constructor (append (list (string-append #$syncthing "/bin/syncthing") "-no-browser" --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 28 15:45:05 2023 Received: (at 62401) by debbugs.gnu.org; 28 Mar 2023 19:45:05 +0000 Received: from localhost ([127.0.0.1]:50744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phFFh-0005DR-7f for submit@debbugs.gnu.org; Tue, 28 Mar 2023 15:45:05 -0400 Received: from mail-ed1-f46.google.com ([209.85.208.46]:41716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phFFf-0005Cc-I1 for 62401@debbugs.gnu.org; Tue, 28 Mar 2023 15:45:04 -0400 Received: by mail-ed1-f46.google.com with SMTP id h8so54232853ede.8 for <62401@debbugs.gnu.org>; Tue, 28 Mar 2023 12:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1680032697; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=jUPLpMWjJZDQ67N2NgrXVEkQIsSFqA6tmUlxYvXJCa8=; b=Vg2VGANgUWZ2ZAkidaC0c9uYW0L7U2NRSTuBrn1RdzqrQAv1wioNBQKlmtT71APyX9 A3YfjyT5VuPHmvaw457h7L165T8S8ZfSZQFIZrhjT2ce6OupXhicCbzD4R/sEJUB5HXL rlzzxsVKK+Wfj1uzrtdr8ojfK4TL8jZAazKNg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680032697; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=jUPLpMWjJZDQ67N2NgrXVEkQIsSFqA6tmUlxYvXJCa8=; b=u8eydH7iGgWh/xKcpz73dG2FKjS0mk5ogKSfu4JbcWdY7op7Fa3qTlf5araJL6GCjr qSJSOLhJIIenxHLUpCgq9qbodtCWhwnpuZ55jP24ajHZn04zN4O03yr2v1cEzUddvbzn c63pQo9XkhF2gGPH7jefUq2s6233RWA6LKdEMppzDtZfr1UO9iD7wj0yviq9JHeqyzJb NwINjO4UICm06b8lyp/u6x/XTDE7an+QxuGDCSc3gQ6HcZrp/0QMGUHNlOWDJ1ukicI2 iziqITPxu7/sQJT0uG4qRLhDW29p4TuAerNj5waz1D4cWYm9Z5viuBTL8wJhLQZPxQ+h CT7g== X-Gm-Message-State: AAQBX9ftI/ttBSsNCpGRy+dQDoXCtrZeOUfYqMIMZDvpFoESReIx9Gy+ +YMlpnFr5PZk9Rf5By3/paPWBR9XBJBt+p4gVd1jRA== X-Google-Smtp-Source: AKy350aosbsaZa4uIe2nzhFys9NOwFXcskObo4B8lBVHylXb8G5zPi55jrbdq47AhgMvABaF0wszkw== X-Received: by 2002:a17:907:1c95:b0:93d:e6c8:ed5e with SMTP id nb21-20020a1709071c9500b0093de6c8ed5emr19943956ejc.20.1680032697654; Tue, 28 Mar 2023 12:44:57 -0700 (PDT) Received: from localhost ([95.168.146.53]) by smtp.gmail.com with ESMTPSA id l19-20020a170906079300b00932ed432475sm14368725ejc.124.2023.03.28.12.44.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 12:44:57 -0700 (PDT) References: <20230323081026.13850-1-sarg@sarg.org.ru> <87o7ocg960.fsf@gnu.org> User-agent: mu4e 1.10.0; emacs 29.0.60 From: Sergey Trofimov To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#62401] [PATCH] home: Add home-syncthing-service-type. Date: Tue, 28 Mar 2023 21:29:15 +0200 In-reply-to: <87o7ocg960.fsf@gnu.org> Message-ID: <87ilek64p4.fsf@sarg.org.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62401 Cc: paren@disroot.org, 62401@debbugs.gnu.org, andrew@trop.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ludovic, Ludovic Courtès writes: > Hi, > > Sergey Trofimov skribis: > >> * gnu/home/services/syncthing.scm >> (home-syncthing-service-type): New variable. >> (home-syncthing-configuration): New procedure. >> * gnu/services/syncthing.scm >> (syncthing-shepherd-service): Adapt to be used as a home >> service. >> * doc/guix.texi: Ditto. > > Nice! > > Note: You can just say “New file” for a new file; however please > specify > the name of the node added to the manual, for clarity. So it looks like this? --8<---------------cut here---------------start------------->8--- * gnu/home/services/syncthing.scm: New file. * doc/guix.texi: Document home-syncthing-service-type and home-syncthing-configuration. --8<---------------cut here---------------end--------------->8--- >> +(define syncthing-home-shepherd-service >> + (lambda (configuration) >> + (map (lambda (srv) (shepherd-service (inherit srv) >> (requirement '()))) >> + ((@@ (gnu services syncthing) >> syncthing-shepherd-service) configuration)))) > > You could do that without resorting to @@, by using ‘find’ on > the > extensions of ‘syncthing-service-type’. Not sure I get you. I use @@ because `syncthing-shepherd-service` is not exported and I want to leave that as is. >> diff --git a/gnu/services/syncthing.scm >> b/gnu/services/syncthing.scm >> index 7c3d5b027d..960f0a1db8 100644 >> --- a/gnu/services/syncthing.scm >> +++ b/gnu/services/syncthing.scm >> @@ -43,8 +43,7 @@ (define-record-type* >> >> (default '())) >> (logflags syncthing-configuration-logflags ;number >> (default 0)) >> - (user syncthing-configuration-user ;string >> - (default #f)) >> + (user syncthing-configuration-user) ;string > > This means that users of ‘syncthing-service-type’ will now have > to > provide a value for ‘user’, which wasn’t the case until now. Is > this > change necessary? > The existing code fails on this line, when the user is not specified: --8<---------------cut here---------------start------------->8--- (provision (list (string->symbol (string-append "syncthing-" user)))) --8<---------------cut here---------------end--------------->8--- string-append doesn't accept nil args > > The rest looks reasonable to me. My main concern is whether it > would > make sense to automate system->home service translation. I’ll > expand on > that separately. Does guix really need a system syncthing service? It runs under `user`, looks for configuration in `/home/user` and therefore looks out of place in the system services list. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 28 15:59:20 2023 Received: (at 62401) by debbugs.gnu.org; 28 Mar 2023 19:59:21 +0000 Received: from localhost ([127.0.0.1]:50763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phFTU-0005gR-Jd for submit@debbugs.gnu.org; Tue, 28 Mar 2023 15:59:20 -0400 Received: from mail-4317.proton.ch ([185.70.43.17]:42125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phFTT-0005gA-Gt for 62401@debbugs.gnu.org; Tue, 28 Mar 2023 15:59:20 -0400 Date: Tue, 28 Mar 2023 19:59:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1680033553; x=1680292753; bh=z2lptO+n8ebVHsmkEFvXF6VOv45N0WH5v3SZwY8q8FE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Jtq5v/zg1dPJmVaEnv3mgBTHKMLr9qIzEcPNJOEYVPknjBEuLNb602Lmy2FwpmHqp Xg/acyYMhMuwGiaDzW3lmWw/z0Q8dd4YTcdD7HVMEgCc2guMgsBbA0nKAEiiA3xuIz ZF65ioAOpkbmpezMKnIPur4IDS1zH3xH4ZvTicIimydBzp1j6YQeb68PSaNS9xiuG2 BZneoduoVlVeLW9HP2zXIayBAfXHnWzZkxv30e9bhH5TpqLPX/al54qQ2JOr634It4 JuV3xhDHz6u37p+WLSeWvE6uRMquTVo+Z+3t0S+4GiwM/uAkfoS6TLEmRgfrT136Hn oT2arylEMKj6w== To: =?utf-8?Q?Ludovic_Court=C3=A8s?= From: Attila Lendvai Subject: Re: Automatically mapping services from System to Home Message-ID: In-Reply-To: <87edp8g88j.fsf@gnu.org> References: <20230323081026.13850-1-sarg@sarg.org.ru> <87edp8g88j.fsf@gnu.org> Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62401 Cc: guix-devel@gnu.org, paren@disroot.org, 62401@debbugs.gnu.org, Sergey Trofimov , andrew@trop.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Thoughts? my gut reaction is that whatever the automatic mapping does should be captu= red/reified into the code that defines a service... factoring out the commo= n parts, and adding on top of that whatever is necessary in the two differe= nt contexts. but then i'm not sure i fully understand the differences between these two = contexts, and i don't have a proposal.diff either, so... BTW, what are the differences? - a possible call to setuid/setgid, and their values in the config if the service is not to be started as root? - the default values of the config file and log file(s)? possibly some service-specific values in the config whose default value depend on the user/group under which the service is running? maybe the user/group should be a mandatory value under the hood, and the se= rvice code should dispatch on their values and the current effective user/g= roup id, and act accordingly? what am i missing? --=20 =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CThe moral law is one of the basic laws of the universe. It is like= wise called the principle of Karma, the result of cause and effect, or acti= on and reaction. There is nothing vindictive about this principle. It works= impersonally like any law of nature. As the fruit is contained in the seed= , so the consequences are inherent in the act. This principle guides the de= stinies of both people and nations. Knowledge of this principle gives human= beings the power to control our own destiny.=E2=80=9D =09=E2=80=94 Thor Kiimaletho From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 29 11:21:09 2023 Received: (at 62401) by debbugs.gnu.org; 29 Mar 2023 15:21:10 +0000 Received: from localhost ([127.0.0.1]:54736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phXbp-0003VG-F5 for submit@debbugs.gnu.org; Wed, 29 Mar 2023 11:21:09 -0400 Received: from smtpmciv1.myservices.hosting ([185.26.107.237]:35048) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phXbm-0003V6-PX for 62401@debbugs.gnu.org; Wed, 29 Mar 2023 11:21:07 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv1.myservices.hosting (Postfix) with ESMTP id 505A520D58; Wed, 29 Mar 2023 17:21:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id CBF358009A; Wed, 29 Mar 2023 17:21:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id c6dWjh4-o5st; Wed, 29 Mar 2023 17:21:03 +0200 (CEST) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id C54D180098; Wed, 29 Mar 2023 17:21:02 +0200 (CEST) Message-ID: <07fc2e40-7e23-a7cb-469d-95aae6614ff5@makinata.eu> Date: Wed, 29 Mar 2023 16:21:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: Automatically mapping services from System to Home Content-Language: en-US To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= , Sergey Trofimov References: <20230323081026.13850-1-sarg@sarg.org.ru> <87edp8g88j.fsf@gnu.org> From: Bruno Victal In-Reply-To: <87edp8g88j.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 62401 Cc: guix-devel@gnu.org, paren@disroot.org, 62401@debbugs.gnu.org, andrew@trop.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hi Ludo’, On 2023-03-28 17:18, Ludovic Courtès wrote: > One idea I toyed with is automatic translation of service types from > System to Home. The service itself would look like this: > > --8<---------------cut here---------------start------------->8--- > (define-module (gnu home services syncthing) > #:use-module (gnu home services) > #:use-module (gnu services syncthing) > #:export (home-syncthing-service-type) > #:re-export (syncthing-configuration > syncthing-configuration?)) > > (define home-syncthing-service-type > (system-service-type->home-service-type syncthing-service-type)) > --8<---------------cut here---------------end--------------->8--- > > The code to do that is attached below. The key here is that we’d define > mappings, like: > > (define-service-type-mapping > shepherd-root-service-type => home-shepherd-service-type) > > The rest of the service type graph would be automatically constructed > from this. > > I feel like it would be worth pursuing this path so that there’s as > little duplication as possible between Home and System. > > OTOH, it doesn’t take care of things like #:user in > ‘make-forkexec-constructor’ calls and the like. > I've been thinking that shepherd services should, in general, come with a preamble in their configuration record-types. (perhaps à la SRFI-136 parent-style records?) Below is a non-exhaustive list of “things” that should almost always be configurable, unless it's reasonable to omit it: --8<---------------cut here---------------start------------->8--- ;; These fields were listed based on “experience” in reworking, ;; repurposing and adding new (system) services within Guix. (define-configuration example-configuration ;; Allow the package to be overridden. (package file-like "Lorem ipsum …") ;; Note that they're not strings. This allows for tailoring ;; the user-account used by the service (e.g. adding extra groups ;; for the daemon to have access to other directories, etc. (user user-account "Lorem ipsum …") ;; ^^^^^ Ditto. (group user-group "Lorem ipsum …") (shepherd-requirement ; or shepherd-requirements, the former already has some presence in Guix ; but could be phased-out in favor of the plural form list-of-symbols "Lorem ipsum …") ;; Uncommonly seen among services ;; but mpd-service-type is an example where this is important. (environment-variables list-of-env-vars "Lorem ipsum …") --8<---------------cut here---------------end--------------->8--- Tossing another idea in the air, with define-configuration could perhaps be enriched with additional parameters to hint that certain fields should be treated differently depending on “context”? Naturally the service code will have to be adjusted to use these hints, but overall it should result in a much cleaner way to guide serializations and service-extension pruning. It could be something of the sort: --8<---------------cut here---------------start------------->8--- (define-configuration example-configuration … (user user-account "Lorem ipsum …" (attributes 'system-service) …) ;; or (define-configuration example-configuration … (user user-account "Lorem ipsum …" system-only …) ;; or (define-configuration example-configuration … (user user-account "Lorem ipsum …" (system #t) (home #f) …) --8<---------------cut here---------------end--------------->8--- Cheers, Bruno From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 29 12:35:35 2023 Received: (at 62401) by debbugs.gnu.org; 29 Mar 2023 16:35:35 +0000 Received: from localhost ([127.0.0.1]:54835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phYlq-0005Pl-VY for submit@debbugs.gnu.org; Wed, 29 Mar 2023 12:35:35 -0400 Received: from smtpm1.myservices.hosting ([185.26.105.232]:34712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phYlq-0005Pd-3k for 62401@debbugs.gnu.org; Wed, 29 Mar 2023 12:35:34 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm1.myservices.hosting (Postfix) with ESMTP id 5FA0720A78; Wed, 29 Mar 2023 18:35:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 02F8C80098; Wed, 29 Mar 2023 18:35:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id HG7VtVNuS24v; Wed, 29 Mar 2023 18:35:31 +0200 (CEST) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 62A6980097; Wed, 29 Mar 2023 18:35:31 +0200 (CEST) Message-ID: Date: Wed, 29 Mar 2023 17:35:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [bug#62401] [PATCH] home: Add home-syncthing-service-type. Content-Language: en-US To: Sergey Trofimov References: <20230323081026.13850-1-sarg@sarg.org.ru> <87o7ocg960.fsf@gnu.org> <87ilek64p4.fsf@sarg.org.ru> From: Bruno Victal In-Reply-To: <87ilek64p4.fsf@sarg.org.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 62401 Cc: paren@disroot.org, 62401@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=c3=a8s?= , andrew@trop.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hi Sergey, On 2023-03-28 20:29, Sergey Trofimov wrote: > > Does guix really need a system syncthing service? It runs under `user`, looks for configuration in `/home/user` and therefore looks out of place in the system services list. > A system service doesn't necessarily mean root or "non-interactive/system user" only. It's a service that can be configured by the system admin and it can be made to run under any user. Someone could very well want to configure some kinds of services within config.scm rather than having to manage both a system and user config. My 2¢. Cheers, Bruno From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 07 05:50:55 2023 Received: (at 62401) by debbugs.gnu.org; 7 Aug 2023 09:50:55 +0000 Received: from localhost ([127.0.0.1]:60630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSwt5-0000JL-IE for submit@debbugs.gnu.org; Mon, 07 Aug 2023 05:50:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSwt3-0000J9-Bi for 62401@debbugs.gnu.org; Mon, 07 Aug 2023 05:50:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSwst-0003y5-QV; Mon, 07 Aug 2023 05:50:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Lt8WQJCOhMQ9PGcEMwUqnGS9NY1fQeAxnvCJlke/YNM=; b=G+lJQlZ5Ei2kKX2MX6Qx RbrQG4Eki5kGs8HqX+gL9iHlezC7a+QGyxukBgp9hL34rZHZ1vNr9alpeNHqon3nJ+wW1iCrLNBG8 K4jZSqNySTrS0zlTScB1bYDOsBa4Anv7d7iRLcNZGHjMdZGD46jvUxyaM2Ow1eCfckUm/AAvRHhyL jkWMf7p5mjLqAznVU9Arab1wWKeAwDr7tINRx/vuKZjKOz+q+BxXG0TosMhwjtg2Ors8R2BD4omhV PYdy8+LrjW6PSemnxY4fMTOuYob088h8hf5fRWv10Ll8omHebhh0yAwJ5ilUs6Tw3yqaNwcKXV4Pz uH7luQsH6e19Ag==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Bruno Victal , Sergey Trofimov Subject: Re: bug#62401: [PATCH] home: Add home-syncthing-service-type. References: <20230323081026.13850-1-sarg@sarg.org.ru> <87edp8g88j.fsf@gnu.org> <07fc2e40-7e23-a7cb-469d-95aae6614ff5@makinata.eu> Date: Mon, 07 Aug 2023 11:50:39 +0200 In-Reply-To: <07fc2e40-7e23-a7cb-469d-95aae6614ff5@makinata.eu> (Bruno Victal's message of "Wed, 29 Mar 2023 16:21:02 +0100") Message-ID: <87edkfw58w.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62401 Cc: guix-devel@gnu.org, paren@disroot.org, 62401@debbugs.gnu.org, andrew@trop.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Bruno, Sergey, and all, is an attempt to provide a consistent and simple way to =E2=80=9Cport=E2=80=9D System services to Home= , including Syncthing, as discussed in this thread. Let me know what you think! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 09:02:30 2023 Received: (at control) by debbugs.gnu.org; 21 Aug 2023 13:02:30 +0000 Received: from localhost ([127.0.0.1]:55820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY4YA-0003yS-5T for submit@debbugs.gnu.org; Mon, 21 Aug 2023 09:02:30 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:41377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY4Y9-0003yF-5I for control@debbugs.gnu.org; Mon, 21 Aug 2023 09:02:29 -0400 Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludo@gnu.org; dmarc=fail (p=none dis=none) d=gnu.org X-IronPort-AV: E=Sophos;i="6.01,190,1684792800"; d="scan'208";a="121697355" Received: from unknown (HELO ribbon) ([193.50.110.195]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2023 15:02:20 +0200 Date: Mon, 21 Aug 2023 15:02:19 +0200 Message-Id: <87h6osblb8.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #62401 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) close 62401 quit From unknown Thu Jun 19 14:13:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 19 Sep 2023 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator