summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilko Meyer <w@wmeyer.eu>2024-10-23 17:02:57 +0200
committerRicardo Wurmus <rekado@elephly.net>2026-02-09 16:27:42 +0100
commiteee1bfbec5f281fb3b21b0d6bc4db88187d113b5 (patch)
treefbb48067df66fe72fd619033e92e6720a7637a23
parent84d6e780e1cf42caae8b9f9b0321267d99da4ddb (diff)
gnu: services: Add xandikos-service-type.
* gnu/services/dav.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add file. * doc/guix.texi (DAV Services): Document the service. Change-Id: I5345efd579f9e527eb8798397b52bf1b9b4cab56
-rw-r--r--doc/guix.texi57
-rw-r--r--gnu/local.mk2
-rw-r--r--gnu/services/dav.scm107
3 files changed, 166 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index cb22e612e42..9d41b43d94e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -131,6 +131,7 @@ Copyright @copyright{} 2024 Dariqq@*
131Copyright @copyright{} 2024 Denis 'GNUtoo' Carikli@* 131Copyright @copyright{} 2024 Denis 'GNUtoo' Carikli@*
132Copyright @copyright{} 2024 Fabio Natali@* 132Copyright @copyright{} 2024 Fabio Natali@*
133Copyright @copyright{} 2024 Arnaud Daby-Seesaram@* 133Copyright @copyright{} 2024 Arnaud Daby-Seesaram@*
134Copyright @copyright{} 2024 Wilko Meyer@*
134Copyright @copyright{} 2024-2025 Nigko Yerden@* 135Copyright @copyright{} 2024-2025 Nigko Yerden@*
135Copyright @copyright{} 2024 Troy Figiel@* 136Copyright @copyright{} 2024 Troy Figiel@*
136Copyright @copyright{} 2024 Sharlatan Hellseher@* 137Copyright @copyright{} 2024 Sharlatan Hellseher@*
@@ -431,6 +432,7 @@ Services
431* DNS Services:: DNS daemons. 432* DNS Services:: DNS daemons.
432* VNC Services:: VNC daemons. 433* VNC Services:: VNC daemons.
433* VPN Services:: VPN daemons. 434* VPN Services:: VPN daemons.
435* DAV Services:: DAV daemons.
434* Network File System:: NFS related services. 436* Network File System:: NFS related services.
435* Samba Services:: Samba services. 437* Samba Services:: Samba services.
436* Continuous Integration:: Cuirass and Laminar services. 438* Continuous Integration:: Cuirass and Laminar services.
@@ -19882,6 +19884,7 @@ declaration.
19882* DNS Services:: DNS daemons. 19884* DNS Services:: DNS daemons.
19883* VNC Services:: VNC daemons. 19885* VNC Services:: VNC daemons.
19884* VPN Services:: VPN daemons. 19886* VPN Services:: VPN daemons.
19887* DAV Services:: DAV daemons.
19885* Network File System:: NFS related services. 19888* Network File System:: NFS related services.
19886* Samba Services:: Samba services. 19889* Samba Services:: Samba services.
19887* Continuous Integration:: Cuirass and Laminar services. 19890* Continuous Integration:: Cuirass and Laminar services.
@@ -37736,6 +37739,60 @@ a firewall.
37736@end table 37739@end table
37737@end deftp 37740@end deftp
37738 37741
37742@node DAV Services
37743@subsection DAV Services
37744@cindex CalDAV
37745
37746@defvar xandikos-service-type
37747This service starts @code{xandikos}, a lightweight CardDAV/CalDAV
37748server backed by a Git repository.
37749
37750The service's value is a @code{xandikos-configuration} record.
37751@end defvar
37752
37753@deftp {Data Type} xandikos-configuration
37754This is the data type representing the configuration for the
37755@code{xandikos-shepherd-service}.
37756
37757It has the following parameters:
37758
37759@table @asis
37760@item @code{package} (default: @code{xandikos})
37761The @code{xandikos} package to use.
37762
37763@item @code{directory} (default: @code{"/var/xandikos/dav"})
37764The directory to serve from.
37765
37766@item @code{listen-address} (default: @code{127.0.0.1})
37767The address @command{xandikos} listens on.
37768
37769@item @code{port} (default: @code{8080})
37770The port to run @command{xandikos} on.
37771
37772@item @code{current-user-principal} (default: @code{"/user/"})
37773Path to current user principal.
37774
37775@item @code{route-prefix} (default: @code{"/"})
37776Path to @command{xandikos} (useful when Xandikos is behind a reverse proxy).
37777
37778@item @code{defaults?} (default: @code{#t})
37779Create initial calendar and address book. Implies @option{--autocreate}.
37780
37781@item @code{dump?} (default: @code{#f})
37782Print DAV XML request/responses.
37783
37784@item @code{avahi?} (default: @code{#f})
37785Announce services with avahi.
37786
37787@item @code{autocreate?} (default: @code{#f})
37788Automatically create necessary directories.
37789
37790@item @code{no-strict?} (default: @code{#f})
37791Enable workarounds for buggy CalDAV/CardDAV client implementations.
37792@end table
37793@end deftp
37794
37795
37739@node Network File System 37796@node Network File System
37740@subsection Network File System 37797@subsection Network File System
37741@cindex NFS 37798@cindex NFS
diff --git a/gnu/local.mk b/gnu/local.mk
index 07b2390315d..eee60193533 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -67,6 +67,7 @@
67# Copyright © 2024, 2025 David Elsing <david.elsing@posteo.net> 67# Copyright © 2024, 2025 David Elsing <david.elsing@posteo.net>
68# Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se> 68# Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
69# Copyright © 2024 Fabio Natali <me@fabionatali.com> 69# Copyright © 2024 Fabio Natali <me@fabionatali.com>
70# Copyright © 2024 Wilko Meyer <w@wmeyer.eu>
70# Copyright © 2024 Noé Lopez <noelopez@free.fr> 71# Copyright © 2024 Noé Lopez <noelopez@free.fr>
71# Copyright © 2024 Runciter <runciter@whispers-vpn.org> 72# Copyright © 2024 Runciter <runciter@whispers-vpn.org>
72# Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com> 73# Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
@@ -735,6 +736,7 @@ GNU_SYSTEM_MODULES = \
735 %D%/services/cuirass.scm \ 736 %D%/services/cuirass.scm \
736 %D%/services/cups.scm \ 737 %D%/services/cups.scm \
737 %D%/services/databases.scm \ 738 %D%/services/databases.scm \
739 %D%/services/dav.scm \
738 %D%/services/dbus.scm \ 740 %D%/services/dbus.scm \
739 %D%/services/desktop.scm \ 741 %D%/services/desktop.scm \
740 %D%/services/dict.scm \ 742 %D%/services/dict.scm \
diff --git a/gnu/services/dav.scm b/gnu/services/dav.scm
new file mode 100644
index 00000000000..875d197f2c6
--- /dev/null
+++ b/gnu/services/dav.scm
@@ -0,0 +1,107 @@
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2024 Wilko Meyer <w@wmeyer.eu>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu services dav)
20 #:use-module (gnu packages dav)
21 #:use-module (gnu services)
22 #:use-module (gnu services configuration)
23 #:use-module (gnu services shepherd)
24 #:use-module (guix deprecation)
25 #:use-module (guix gexp)
26 #:use-module (guix records)
27 #:use-module (ice-9 match)
28 #:export (xandikos-configuration
29 xandikos-configuration?
30 xandikos-service-type))
31
32;;;
33;;; Xandikos.
34;;;
35
36(define (port? x)
37 (and (number? x)
38 (and (>= x 0) (<= x 65535))))
39
40(define-configuration/no-serialization xandikos-configuration
41 (package
42 (file-like xandikos)
43 "Xandikos package to use.")
44 (directory
45 (string "/var/xandikos/dav")
46 "Directory to serve from.")
47 (listen-address
48 (string "127.0.0.1")
49 "The address Xandikos listens on.")
50 (port
51 (port 8080)
52 "The port to run Xandikos on.")
53 (current-user-principal
54 (string "/user/")
55 "Path to current user principal.")
56 (route-prefix
57 (string "/")
58 "Path to Xandikos. (Useful when Xandikos is behind a reverse proxy.)")
59 (defaults?
60 (boolean #t)
61 "Create initial calendar and address book.")
62 (dump?
63 (boolean #f)
64 "Print DAV XML request/responses.")
65 (avahi?
66 (boolean #f)
67 "Announce services with avahi.")
68 (autocreate?
69 (boolean #f)
70 "Automatically create necessary directories.")
71 (no-strict?
72 (boolean #f)
73 "Enable workarounds for buggy CalDAV/CardDAV client implementations."))
74
75(define (xandikos-shepherd-service config)
76 (match-record config <xandikos-configuration>
77 (package directory listen-address port current-user-principal
78 route-prefix defaults? dump? avahi? autocreate?
79 no-strict?)
80 (list
81 (shepherd-service
82 (provision '(xandikos))
83 (documentation "Caldav/CardDAV server")
84 (requirement '(networking user-processes))
85 (start #~(make-forkexec-constructor
86 (list #$(file-append xandikos "/bin/xandikos")
87 "--listen-address" #$listen-address
88 "--port" #$(number->string port)
89 "-d" #$directory
90 "--route-prefix" #$route-prefix
91 "--current-user-principal" #$current-user-principal
92 #$@(if dump? '("--dump-dav-xml") '())
93 #$@(if avahi? '("--avahi") '())
94 #$@(if autocreate? '("--autocreate") '())
95 #$@(if defaults? '("--defaults") '())
96 #$@(if no-strict? '("--no-strict") '()))))
97 (stop #~(make-kill-destructor))
98 (respawn? #t)))))
99
100(define xandikos-service-type
101 (service-type
102 (name 'xandikos)
103 (extensions
104 (list (service-extension shepherd-root-service-type
105 xandikos-shepherd-service)))
106 (default-value (xandikos-configuration))
107 (description "Service to run the @code{Xandikos} CalDAV/CardDAV server.")))