diff options
| author | Sergio Pastor Pérez <sergio.pastorperez@gmail.com> | 2026-07-25 19:41:21 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-08-21 16:00:23 +0200 |
| commit | 08edc6d5ef72d1fca3088bc6635b6701bcde0b45 (patch) | |
| tree | 10c6237fff303ecb0f6236c3ba4d056e8f1f5375 | |
| parent | bf1f18130f2b54a2bd1e8a57d6dae3a611573ee8 (diff) | |
services: Rewrite 'zulip-irc-bridge-configuration' with 'define-configuration/no-serialization'.
* gnu/services/messaging.scm (zulip-irc-bridge-configuration): Rewrite using
'define-configuration/no-serialization'.
(zulip-irc-bridge-services): Adjust for handling 'maybe-string' types.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #10180
| -rw-r--r-- | doc/guix.texi | 24 | ||||
| -rw-r--r-- | gnu/services/messaging.scm | 46 |
2 files changed, 46 insertions, 24 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 3f0c0c51f4d..e1701a0d17d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -33141,8 +33141,8 @@ strings, see | |||
| 33141 | @cindex IRC, bridge to Zulip | 33141 | @cindex IRC, bridge to Zulip |
| 33142 | @cindex Zulip, bridge to IRC | 33142 | @cindex Zulip, bridge to IRC |
| 33143 | @url{https://zulip.com/integrations/irc, Zulip IRC integration} is a | 33143 | @url{https://zulip.com/integrations/irc, Zulip IRC integration} is a |
| 33144 | Zulip extension to bridge @acronym{IRC, Internet Relay Chat} room to a | 33144 | Zulip extension to bridge an @acronym{IRC, Internet Relay Chat} room to |
| 33145 | stream in the Zulip messaging system. | 33145 | a stream in the Zulip messaging system. |
| 33146 | 33146 | ||
| 33147 | @defvar zulip-irc-bridge-service-type | 33147 | @defvar zulip-irc-bridge-service-type |
| 33148 | This is the service type for the Zulip IRC bridge. Its value is a | 33148 | This is the service type for the Zulip IRC bridge. Its value is a |
| @@ -33172,26 +33172,30 @@ room to a Zulip stream. | |||
| 33172 | 33172 | ||
| 33173 | @end defvar | 33173 | @end defvar |
| 33174 | 33174 | ||
| 33175 | @c %end of fragment | 33175 | @c %start of fragment |
| 33176 | 33176 | ||
| 33177 | @deftp {Data Type} zulip-irc-bridge-configuration | 33177 | @deftp {Data Type} zulip-irc-bridge-configuration |
| 33178 | Available @code{zulip-irc-bridge-configuration} fields are: | 33178 | Available @code{zulip-irc-bridge-configuration} fields are: |
| 33179 | 33179 | ||
| 33180 | @table @asis | 33180 | @table @asis |
| 33181 | @item @code{irc-mirror} (default: @code{(file-append python-zulip "/share/zulip/integrations/bridge_with_irc/irc-mirror.py")}) (type: file-like) | 33181 | @item @code{irc-mirror} (type: file-like) |
| 33182 | Path to IRC mirror integration to use for the service. | 33182 | Path to the IRC mirror integration software to use. |
| 33183 | 33183 | ||
| 33184 | @item @code{irc-server} (type: string) | 33184 | @item @code{irc-server} (type: string) |
| 33185 | The IRC server where to search the room to mirror. | 33185 | The IRC server where the channel to mirror is hosted. |
| 33186 | 33186 | ||
| 33187 | @item @code{channel} (type: string) | 33187 | @item @code{channel} (type: string) |
| 33188 | The Zulip where to store the topic where IRC will be mirrored. | 33188 | The IRC room to mirror. |
| 33189 | 33189 | ||
| 33190 | @item @code{nick-prefix} (type: string) | 33190 | @item @code{nick-prefix} (type: string) |
| 33191 | Bot nickname. | 33191 | Bot nickname. |
| 33192 | 33192 | ||
| 33193 | @item @code{stream} (type: string) | 33193 | @item @code{stream} (type: string) |
| 33194 | The Zulip stream/topic where the mirroring takes place. | 33194 | The Zulip stream where the mirroring takes place. |
| 33195 | |||
| 33196 | @item @code{topic} (type: maybe-string) | ||
| 33197 | The Zulip topic to mirror the IRC room under. Defaults to IRC if not | ||
| 33198 | specified. | ||
| 33195 | 33199 | ||
| 33196 | @item @code{site} (type: string) | 33200 | @item @code{site} (type: string) |
| 33197 | The Zulip server that the IRC bridge integration should operate on. | 33201 | The Zulip server that the IRC bridge integration should operate on. |
| @@ -33200,12 +33204,14 @@ The Zulip server that the IRC bridge integration should operate on. | |||
| 33200 | The Zulip bot email that the IRC integration service should use. | 33204 | The Zulip bot email that the IRC integration service should use. |
| 33201 | 33205 | ||
| 33202 | @item @code{api-key} (type: string) | 33206 | @item @code{api-key} (type: string) |
| 33203 | The API key of the Zulip bot that will send the mirrored messages. | 33207 | The API key that the Zulip bot will use for authenticating with the |
| 33208 | Zulip site. | ||
| 33204 | 33209 | ||
| 33205 | @end table | 33210 | @end table |
| 33206 | 33211 | ||
| 33207 | @end deftp | 33212 | @end deftp |
| 33208 | 33213 | ||
| 33214 | |||
| 33209 | @c %end of fragment | 33215 | @c %end of fragment |
| 33210 | 33216 | ||
| 33211 | @node Telephony Services | 33217 | @node Telephony Services |
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm index 017c4048250..0be175d8af2 100644 --- a/gnu/services/messaging.scm +++ b/gnu/services/messaging.scm | |||
| @@ -2735,20 +2735,36 @@ point to different things after a reload, such as renewed TLS certificates.") | |||
| 2735 | ;;; Zulip. | 2735 | ;;; Zulip. |
| 2736 | ;;; | 2736 | ;;; |
| 2737 | 2737 | ||
| 2738 | (define-record-type* <zulip-irc-bridge-configuration> | 2738 | (define-configuration/no-serialization zulip-irc-bridge-configuration |
| 2739 | zulip-irc-bridge-configuration make-zulip-irc-bridge-configuration | 2739 | (irc-mirror |
| 2740 | zulip-irc-bridge-configuration? | 2740 | (file-like |
| 2741 | (irc-mirror zulip-irc-bridge-mirror | 2741 | (file-append python-zulip "/bin/zulip-irc-bridge")) |
| 2742 | (default (file-append python-zulip "/bin/zulip-irc-bridge"))) | 2742 | "Path to IRC mirror integration to use for the service.") |
| 2743 | (irc-server zulip-irc-bridge-server) | 2743 | (irc-server |
| 2744 | (channel zulip-irc-bridge-channel) | 2744 | string |
| 2745 | (nick-prefix zulip-irc-bridge-nick-prefix) | 2745 | "The IRC server where the channel to mirror is hosted.") |
| 2746 | (stream zulip-irc-bridge-stream) | 2746 | (channel |
| 2747 | (topic zulip-irc-bridge-topic | 2747 | string |
| 2748 | (default #f)) | 2748 | "The IRC room to mirror.") |
| 2749 | (site zulip-irc-bridge-site) | 2749 | (nick-prefix |
| 2750 | (user zulip-irc-bridge-user) | 2750 | string |
| 2751 | (api-key zulip-irc-bridge-api-key)) | 2751 | "Bot nickname.") |
| 2752 | (stream | ||
| 2753 | string | ||
| 2754 | "The Zulip stream where the mirroring takes place.") | ||
| 2755 | (topic | ||
| 2756 | maybe-string | ||
| 2757 | "The Zulip topic to mirror the IRC room under. Defaults to IRC if not | ||
| 2758 | specified.") | ||
| 2759 | (site | ||
| 2760 | string | ||
| 2761 | "The Zulip server that the IRC bridge integration should operate on.") | ||
| 2762 | (user | ||
| 2763 | string | ||
| 2764 | "The Zulip bot email that the IRC integration service should use.") | ||
| 2765 | (api-key | ||
| 2766 | string | ||
| 2767 | "The API key of the Zulip bot that will send the mirrored messages.")) | ||
| 2752 | 2768 | ||
| 2753 | (define %zulip-accounts | 2769 | (define %zulip-accounts |
| 2754 | (list (user-group | 2770 | (list (user-group |
| @@ -2775,7 +2791,7 @@ point to different things after a reload, such as renewed TLS certificates.") | |||
| 2775 | (string-append "--site=" site) | 2791 | (string-append "--site=" site) |
| 2776 | (string-append "--user=" user) | 2792 | (string-append "--user=" user) |
| 2777 | (string-append "--api-key=" api-key) | 2793 | (string-append "--api-key=" api-key) |
| 2778 | (if topic | 2794 | (if (maybe-value-set? topic) |
| 2779 | (list (string-append "--topic=" topic)) | 2795 | (list (string-append "--topic=" topic)) |
| 2780 | '()))) | 2796 | '()))) |
| 2781 | (log-file "/var/log/zulip-irc-bridge.log")) | 2797 | (log-file "/var/log/zulip-irc-bridge.log")) |
