From unknown Thu Sep 11 12:42:02 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#45590 <45590@debbugs.gnu.org> To: bug#45590 <45590@debbugs.gnu.org> Subject: Status: [PATCH] services: Add syncthing service. Reply-To: bug#45590 <45590@debbugs.gnu.org> Date: Thu, 11 Sep 2025 19:42:02 +0000 retitle 45590 [PATCH] services: Add syncthing service. reassign 45590 guix-patches submitter 45590 Oleg Pykhalov severity 45590 normal tag 45590 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 01 05:39:32 2021 Received: (at submit) by debbugs.gnu.org; 1 Jan 2021 10:39:32 +0000 Received: from localhost ([127.0.0.1]:55390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvHqB-0005ks-IV for submit@debbugs.gnu.org; Fri, 01 Jan 2021 05:39:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:39470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvHq9-0005kk-F4 for submit@debbugs.gnu.org; Fri, 01 Jan 2021 05:39:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvHq9-0006du-8B for guix-patches@gnu.org; Fri, 01 Jan 2021 05:39:25 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]:45707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kvHq7-0006nv-7W for guix-patches@gnu.org; Fri, 01 Jan 2021 05:39:25 -0500 Received: by mail-lf1-x133.google.com with SMTP id x20so48436363lfe.12 for ; Fri, 01 Jan 2021 02:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Sa7ceWKuEBWRUznlChjbtt+TY2erg7znlUp+LcyDveE=; b=hcKL9ipbIwMdFqwUXNwEbDK7WDv/J2jeNmD1tfolhE2ejh2laRk1Jvp/MyYZHx4A0i MI/CUd7p0QJ4BpCtrHE8ZzcfBIknWOeKgCWQVv0x4eF4X5MjExPsrAplReRZb0nCNy14 uBgcdIQ97ptbU13d64Ny1uql1FQPj6UXToY0n4cD9fzpga2H7El3ZDyFMBv0SyKHEw7u Q8UvwNEmXNvlEIB2Nv9vsZ4mDmcZXwIghLc8OhCnIiNiCI9MX0Fbwthks65Bc+ZMrAtu RDl9vOCwjoJnbG+Fo2Eb6N2HoO4Ta2uaBrgxx55OHNcDEy0D9ScyCrufRuNrAD944Cim Aecg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Sa7ceWKuEBWRUznlChjbtt+TY2erg7znlUp+LcyDveE=; b=rxEGc53vl5MsR9qgDvkjoV+bcvwhOORApp9tElIzNQ0qKl28q6eFAQbade1YOn8HRS 8hMW6WtDuUVDK7qMYF1QMUw2ETmYyWRjWkQaUiB/dO8PjELyy0ISCznLhfL+LV+OyBVy bZY+Sk8iCBa7v7drVp2SNMoRgIGq5kDv1A0DK0nfW9HaQnf1hdA2JVJFcBBnlmfXCXZC xR9hlqSiLKK2YskDxAC0gijuNDvipZhIG4FeMpA6OCTElUgmxC/csIf9HLLvFBTc8bG3 8mom3QyRHJWbYDEzB8Fj44I9Uqd9yvmtrFb4d+ICm/ljXA2jO01rlZGIXeEb8lDcJXkk HAmA== X-Gm-Message-State: AOAM533vT6X2LISpa5YqZfpAhAyt3HQ8lY9VF1E8tNnus6hTZxpRsTIr wNJNEZBPcMB+MOc5noBXR21ph5krnDM= X-Google-Smtp-Source: ABdhPJyetEJYctQbqIq550X56rRaSMhRjDIij1QK6LjAjj/wqLrf8qs55/h5VG0WMe0dr087rMyFpA== X-Received: by 2002:a19:4b16:: with SMTP id y22mr29656655lfa.594.1609497560758; Fri, 01 Jan 2021 02:39:20 -0800 (PST) Received: from localhost.localdomain ([178.71.74.207]) by smtp.gmail.com with ESMTPSA id y9sm7815414ljm.94.2021.01.01.02.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jan 2021 02:39:20 -0800 (PST) From: Oleg Pykhalov To: guix-patches@gnu.org Subject: [PATCH] services: Add syncthing service. Date: Fri, 1 Jan 2021 13:39:11 +0300 Message-Id: <20210101103911.18054-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=go.wigust@gmail.com; helo=mail-lf1-x133.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Oleg Pykhalov 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: -0.0 (/) * gnu/services/syncthing.scm: New file. * gnu/local.mk: Add this. * doc/guix.texi: Document this. --- doc/guix.texi | 49 +++++++++++++++++++++ gnu/local.mk | 3 +- gnu/services/syncthing.scm | 89 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 gnu/services/syncthing.scm diff --git a/doc/guix.texi b/doc/guix.texi index 1081ed26a3..cb6fe065ac 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16505,6 +16505,55 @@ Group name or group ID that will be used when accessing the module. @end table @end deftp +The @code{(gnu services syncthing)} module provides the following services: +@cindex syncthing + +You might want a syncthing daemon if you have files between two or more +computers and want to sync them in real time, safely protected from +prying eyes. + +@deffn {Scheme Variable} syncthing-service-type +This is the service type for the @uref{https://syncthing.net/, +syncthing} daemon, The value for this service type is a +@command{syncthing-configuration} record as in this example: + +@lisp +(service syncthing-service-type + (syncthing-configuration (user "alice"))) +@end lisp + +See below for details about @code{syncthing-configuration}. + +@deftp {Data Type} syncthing-configuration +Data type representing the configuration for @code{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 loging flags, see +@uref{https://docs.syncthing.net/users/syncthing.html#cmdoption-logflags, Syncthing documentation logflags}. + +@item @code{user} (default: @var{#f}) +The user as which the Syncthing service is to be run. +This assumes that the specified user exists. + +@item @code{group} (default: @var{"users"}) +The group as which the Syncthing service is to be run. +This assumes that the specified group exists. + +@item @code{home} (default: @var{#f}) +Common configuration and data directory. The default configuration +directory is @file{$HOME} of the specified Syncthing @code{user}. + +@end table +@end deftp +@end deffn + Furthermore, @code{(gnu services ssh)} provides the following services. @cindex SSH @cindex SSH server diff --git a/gnu/local.mk b/gnu/local.mk index 2402b1e349..eed786c0fd 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -17,7 +17,7 @@ # Copyright © 2017, 2020 Mathieu Othacehe # Copyright © 2017, 2018, 2019 Gábor Boskovits # Copyright © 2018 Amirouche Boubekki -# Copyright © 2018, 2019, 2020 Oleg Pykhalov +# Copyright © 2018, 2019, 2020, 2021 Oleg Pykhalov # Copyright © 2018 Stefan Stefanović # Copyright © 2018, 2020 Maxim Cournoyer # Copyright © 2019, 2020 Guillaume Le Vaillant @@ -629,6 +629,7 @@ GNU_SYSTEM_MODULES = \ %D%/services/sddm.scm \ %D%/services/spice.scm \ %D%/services/ssh.scm \ + %D%/services/syncthing.scm \ %D%/services/sysctl.scm \ %D%/services/telephony.scm \ %D%/services/version-control.scm \ diff --git a/gnu/services/syncthing.scm b/gnu/services/syncthing.scm new file mode 100644 index 0000000000..12ebe7c107 --- /dev/null +++ b/gnu/services/syncthing.scm @@ -0,0 +1,89 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Oleg Pykhalov +;;; +;;; 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 services syncthing) + #:use-module (gnu packages syncthing) + #:use-module (gnu services) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (syncthing-configuration + syncthing-configuration? + syncthing-service-type)) + +;;; Commentary: +;;; +;;; This module provides a service definition for the syncthing service. +;;; +;;; Code: + +(define-record-type* + syncthing-configuration make-syncthing-configuration + syncthing-configuration? + (syncthing syncthing-configuration-syncthing ; + (default syncthing)) + (arguments syncthing-configuration-arguments ;list of strings + (default '())) + (logflags syncthing-configuration-logflags ;number + (default 0)) + (user syncthing-configuration-user ;string + (default #f)) + (group syncthing-configuration-group ;string + (default "users")) + (home syncthing-configuration-home ;string + (default #f))) + +(define syncthing-shepherd-service + (match-lambda + (($ syncthing arguments logflags user group home) + (list + (shepherd-service + (provision (list (string->symbol (string-append "syncthing-" user)))) + (documentation "Run syncthing.") + (requirement '(loopback)) + (start #~(make-forkexec-constructor + (append (list (string-append #$syncthing "/bin/syncthing") + "-no-browser" + "-no-restart" + (string-append "-logflags=" (number->string #$logflags))) + '#$arguments) + #:user #$user + #:group #$group + #:environment-variables + (append (list (string-append "HOME=" (or #$home (passwd:dir (getpw #$user)))) + "SSL_CERT_DIR=/etc/ssl/certs" + "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt") + (remove (lambda (str) + (or (string-prefix? "HOME=" str) + (string-prefix? "SSL_CERT_DIR=" str) + (string-prefix? "SSL_CERT_FILE=" str))) + (environ))))) + (respawn? #f) + (stop #~(make-kill-destructor))))))) + +(define syncthing-service-type + (service-type (name 'syncthing) + (extensions (list (service-extension shepherd-root-service-type + syncthing-shepherd-service))) + (description + "Run @uref{https://github.com/syncthing/syncthing, Syncthing} +decentralized continuous file system synchronization."))) + +;;; syncthing.scm ends here -- 2.29.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 12 06:42:37 2021 Received: (at 45590-done) by debbugs.gnu.org; 12 Jan 2021 11:42:37 +0000 Received: from localhost ([127.0.0.1]:59470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzI4L-0002Wi-Fx for submit@debbugs.gnu.org; Tue, 12 Jan 2021 06:42:37 -0500 Received: from mail-lj1-f180.google.com ([209.85.208.180]:40144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzI4J-0002WO-G3 for 45590-done@debbugs.gnu.org; Tue, 12 Jan 2021 06:42:36 -0500 Received: by mail-lj1-f180.google.com with SMTP id x23so2481317lji.7 for <45590-done@debbugs.gnu.org>; Tue, 12 Jan 2021 03:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=GtrJpxJvbLvbHAREaspTdEm2LNFwxaAoqZUa8rtKxzk=; b=haPT5+4K964Ms5iOJ24lNwXDaN8JH3Pav68TwqLFTlUWEcO8elOYZhvpkcMBlGgb1I xnMr4SOuP2D5I+VVclfuylSV+Hfl3bgoucND9/o0EU/HPnLqBQTADENW3a5LatTUTvfa PFWxz/t/TZAwYENEcaEWLiH+z8BqJ+ZH4wABUkax/mCLy5YAQgMYfgv7OZXF6OuJu1ut TpaANsGyWRKHUcnMpnV9n8y4dfvzq4Gai0wPKlI3LIyqAGayjepQ7z869718MANOrFqq fFQp8+8ELaHXay0ObMhsQrRDVHEhwAmSvcnY1gZoJPHeLwJgwbZzULMJA5PdbEPPqJPr tCNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=GtrJpxJvbLvbHAREaspTdEm2LNFwxaAoqZUa8rtKxzk=; b=ohoIP+m6lKMWdTRwS/pw4y0VyS6rlJLvj1CrJ6AUKMVCfiyaasbSsd1q8ces9NO6rp OceKbGCx5RsmGPDjVx8k8/OuoQvzJ0/2bIg4x0511jT5h/TO/xbUHJARfzfGXrFioo+c Me88s74SOZyVLyejJZjfQ1t+hZgKqKzLQJQJIvU2sxxAUxjy2gJ/4PkmkbGMyg865Ze/ W8gfqXL/25YXGRtaXlmlWKHlbSBM3KG+WHD9XHTvIxVU8k1qWEcD1TAig+ZeG3ZS0L5W QuCrw/9SeUi7xyGoIjK9kWXcCqwCmfzYaooaGzo3dPyJjZmTjn1JZ9c28sm2JWgPCZ0o /rtA== X-Gm-Message-State: AOAM530YcRvK00wLvpg4vFO44X7zjdmxd8y0jP153rgNQPzw0XshPVIF nTGtFQqrQvuOCBZ57seVaI5hiptgnDQ= X-Google-Smtp-Source: ABdhPJzL5g2SnV7rr+SH05hjGjsCVmXzJ8SkcC8gVf2S+1pCxQJbTqvxdyNNMKDPnE/qcU/kdV6b1A== X-Received: by 2002:a05:651c:286:: with SMTP id b6mr1828959ljo.232.1610451749479; Tue, 12 Jan 2021 03:42:29 -0800 (PST) Received: from guixsd ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id w14sm362150lfn.169.2021.01.12.03.42.28 for <45590-done@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 03:42:28 -0800 (PST) From: Oleg Pykhalov To: 45590-done@debbugs.gnu.org Subject: Re: bug#45590: Acknowledgement ([PATCH] services: Add syncthing service.) References: <20210101103911.18054-1-go.wigust@gmail.com> Date: Tue, 12 Jan 2021 14:42:19 +0300 In-Reply-To: (GNU bug Tracking System's message of "Fri, 01 Jan 2021 10:40:02 +0000") Message-ID: <87wnwi5qlg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 45590-done 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 (-) --=-=-= Content-Type: text/plain Pushed to master. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAl/9ixsUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+pyb9g//UuUfRsYiz8T3UUhZVIXUwxQqoC64 i3qYbPxhiB/fyDZTjVscEBSw0n+CGBdrTYpo57KAYIE58UA47ZAgpyCWayiOb7Jx m4m10fOeBVol8ziRvzdWwHVGU/g9m+TlV1d9NdQws19BjnLLRXlDKMxUghdMQ0vF A4sK4kyzsSqu3i/btTDKJ4c54akDLy6q6H8IsNDgFSDHC2+uSdTpPcwlkPFqFrqR YmyCDXP2w4V+fg76uFgKYl4xLwKRl47blzzW8nYrLoUADOw45n4J9oaPB39VcaxA Y8B7g2Zbco5YYPPkFcygbgxbuojRTEwKhhovWvseenRLR3ynziLDmS60ToEdE7pK U2YTPCu85EWI3o2S4hxdJ1QICSk6vI2sut2zicfLq92wy/469dixjobhtbTWnL9h y/78sqvScOeguFGBFYfGKq0I/umORA6pIpOwtLX/Uk016QcdKyx5KF33o0crnOxQ X+8tLmfjTfMUHG7NbX7L0jTc0zCmDJIBx2wOfWJH63kxd1CPxMfNd80MsfauhXC4 EjC9S1vO2iDUNg/Nguw+upOv4YGLSGLfKIK+euVvp430/SqVgoyzHSVWDZ/BSuWU 3SQUyieXrBeR+JZ78MSWuElionfOnUCjmsEUwWbRNHhfMWWimbforfD4vA2M86mF TsinESxuW3oU58g= =gscP -----END PGP SIGNATURE----- --=-=-=-- From unknown Thu Sep 11 12:42:02 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, 09 Feb 2021 12:24:13 +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