aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2023 Justin Veilleux <terramorpha@cock.li>
;;;
;;; 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 <http://www.gnu.org/licenses/>.

(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>
  syncthing-configuration make-syncthing-configuration
  syncthing-configuration?
  (syncthing syncthing-configuration-syncthing ;file-like
             (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))
  (home-service? syncthing-configuration-home-service?
                 (default for-home?) (innate)))

(define syncthing-shepherd-service
  (match-record-lambda <syncthing-configuration>
      (syncthing arguments logflags user group home home-service?)
    (list
     (shepherd-service
      (provision (if home-service?
                     '(syncthing)
                     (list (string->symbol
                            (string-append "syncthing-" user)))))
      (documentation "Run syncthing.")
      (requirement (if home-service? '() '(loopback user-processes)))
      (start #~(make-forkexec-constructor
                (append (list (string-append #$syncthing "/bin/syncthing")
                              "--no-browser"
                              "--no-restart"
                              (string-append "--logflags=" (number->string #$logflags)))
                        '#$arguments)
                #:user #$(and (not home-service?) user)
                #:group #$(and (not home-service?) group)
                #:environment-variables
                (append
                 (list
                  (string-append "HOME="
                                 (or #$home
                                     (passwd:dir
                                      (getpw (if (and #$home-service?
                                                      (not #$user))
                                                 (getuid)
                                                 #$user)))))
                              "SSL_CERT_DIR=/etc/ssl/certs"
                              "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")
                        (filter (negate       ;XXX: 'remove' is not in (guile)
                                 (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
uts.Sughosha * gnu/packages/kde.scm (kio-extras)[inputs]: Add gperf, imath, kactivities, kactivities-stats, kbookmarks, kdsoap, libimobiledevice, libkexiv2, libmtp, libplist, libssh, libtirpc, openexr, phonon, samba, shared-mime-info, taglib and zlib. [native-inputs]: Add pkg-config. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-09gnu: akregator: Add missing ktextaddons to inputs.宋文武 * gnu/packages/kde.scm (akregator)[inputs]: Add ktextaddons. 2023-08-03gnu: akregator: Update to 23.04.3.宋文武 * gnu/packages/kde.scm (akregator): Update to 23.04.3. 2023-08-03gnu: qca: Update to 2.3.7.宋文武 * gnu/packages/kde.scm (qca): Update to 2.3.7. 2023-08-03gnu: kirigami-addons: Update to 0.10.0.宋文武 * gnu/packages/kde.scm (kirigami-addons): Update to 0.10.0. 2023-08-03gnu: kdevelop: Update to 23.04.3.宋文武 * gnu/packages/kde.scm (kdevelop): Update to 23.04.3. [arguments]: Use G-Expressions, adjust add-include-path phase. 2023-08-02gnu: kio-extras: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (kio-extras): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kpublictransport: Use G-expressions.Zheng Junjie * gnu/packages/kde.scm (kpublictransport)[arguments]: Rewrite as G-expressions. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kpublictransport: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (kpublictransport): Update to 23.04.3. [native-inputs]: Add tzdata-for-tests. [inputs]: Add networkmanager-qt, ki18n. [arguments]: Enable all tests, add check-setup phase. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kdevelop-pg-qt: Update to 2.2.2.Zheng Junjie * gnu/packages/kde.scm (kdevelop-pg-qt): Update to 2.2.2. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: okular: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (okular): Update to 23.04.3. [native-inputs]: Add desktop-file-utils. [inputs]: Add qtx11extras. [arguments]: Use G-expressions, move check phase after install phase, add check-setup phase. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: marble-qt: Use G-expressions.Zheng Junjie * gnu/packages/kde.scm (marble-qt)[arguments]: Rewrite as G-expressions. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: marble-qt: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (marble-qt): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kopeninghours: Use G-expressions.Zheng Junjie * gnu/packages/kde.scm (kopeninghours)[arguments]: Rewrite as G-expressions. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kopeninghours: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (kopeninghours): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kosmindoormap: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (kosmindoormap): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kpmcore: Use G-expressions.Zheng Junjie * gnu/packages/kde.scm (kpmcore)[arguments]: Rewrite as G-expressions. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kpmcore: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (kpmcore): Update to 23.04.3. [arguments]: enable tests. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kdeconnect: Use G-expressions.Zheng Junjie * gnu/packages/kde.scm (kdeconnect)[arguments]: Rewrite as G-expressions. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kdeconnect: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (kdeconnect): Update to 23.04.3. [native-inputs]: Add wayland-protocols. [inputs]: Add modemmanager-qt, libxkbcommon. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kirigami-addons: Update to 0.9.0.Zheng Junjie * gnu/packages/kde.scm (kirigami-addons): Update to 0.9.0. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: ktimer: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (ktimer): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kcachegrind: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (kcachegrind): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: libkdegames: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (libkdegames): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: libkexiv2: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (libkexiv2): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kdegraphics-mobipocket: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (kdegraphics-mobipocket): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: poxml: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (poxml): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: kdf: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (kdf): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: qca: Update to 2.3.6.Zheng Junjie * gnu/packages/kde.scm (qca): Update to 2.3.6. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: libkomparediff2: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (libkomparediff2): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: baloo-widgets: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (baloo-widgets): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-08-02gnu: grantleetheme: Update to 23.04.3.Zheng Junjie * gnu/packages/kde.scm (grantleetheme): Update to 23.04.3. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> 2023-07-23gnu: fuse@3: Bind to default FUSE variable.Tobias Geerinckx-Rice * gnu/packages/linux.scm (fuse): Rename this… (fuse-2): …to this, and… (fuse-3): …rename this… (fuse): …to this! (fuse-static): Rename this… (fuse-2-static): …to this. Adjust all users. 2023-06-26gnu: kdenlive: Update to 23.04.2Andy Tai * gnu/packages/kde.scm (kdenlive): Update to 23.04.2 Signed-off-by: Christopher Baines <mail@cbaines.net> 2023-06-06gnu: kirigami-addons: Update to 0.8.0.Efraim Flashner * gnu/packages/kde.scm (kirigami-addons): Update to 0.8.0. [source]: Download using git-fetch. 2023-04-07gnu: Purge pre-1.3.0 deprecated packages.Bruno Victal * gnu/packages/bioinformatics.scm (deeptools): Remove variable. * gnu/packages/efi.scm (efi_analyzer): Ditto. * gnu/packages/guile.scm (guile-2.2/bug-fix, guile-json): Ditto. * gnu/packages/image.scm (libjpeg): Ditto. * gnu/packages/kde.scm (kdevplatform): Ditto * gnu/packages/linphone.scm (linphoneqt): Ditto. * gnu/packages/maths.scm (blis-sandybridge, blis-haswell, blis-knl): Ditto. * gnu/packages/mpi.scm (hwloc-2.0): Ditto. * gnu/packages/music.scm (python-abjad, zlfo): Ditto. * gnu/packages/perl.scm (perl-base, perl-parent): Ditto. * gnu/packages/tryton.scm (python-trytond): Ditto. * gnu/packages/video.scm (gnome-mpv): Ditto. * tests/graph.scm: Use guile-json-1. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2023-04-03gnu: kdenlive: Update to 22.12.3.Vinicius Monego * gnu/packages/kde.scm (kdenlive): Update to 22.12.3. 2023-03-10gnu: krita: Update to 5.1.5.Z572 via Guix-patches via * gnu/packages/kde.scm (krita): Update to 5.1.5. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> 2023-02-04gnu: okular: Add wayland support.Andrew Tropin * gnu/packages/kde.scm (okular)[inputs]: Add qtwayland-5.