Subject: Re: [bug#31331] [PATCH 2/2] gnu: services: bitlbee: Add plugins.

From: [email-masked] (Ludovic Courtès)
Date: Mon, 07 May 2018 11:41:53 +0200

Hello!

Pierre-Antoine Rouby <[email-masked]> skribis:

> * gnu/services/messaging.scm (bitlbee): Add plugins argument.

Please mention the changes to <bitlbee-configuration> and
‘bitlbee-shepherd-service’.  (There’s no variable named ‘bitlbee’ in
this file, so the above message wouldn’t work.)

>    (port bitlbee-configuration-port
>          (default 6667))
> +  (plugins bitlbee-plugins
> +           (default '()))

Please update doc/guix.texi to mention the new field.

> +(define (bitlbee-plugin-directory plugins)
> +  "Return a directory containing PLUGINS."
> +  (directory-union "bitlbee-plugins" plugins))
> +
>  (define bitlbee-shepherd-service
>    (match-lambda
> -    (($ <bitlbee-configuration> bitlbee interface port extra-settings)
> -     (let ((conf (plain-file "bitlbee.conf"
> -                             (string-append "
> -  [settings]
> +    (($ <bitlbee-configuration> bitlbee interface port
> +                                plugins extra-settings)
> +     (let ((conf (mixed-text-file "bitlbee.conf"
> +                                  "  [settings]
>    User = bitlbee
>    ConfigDir = /var/lib/bitlbee
>    DaemonInterface = " interface "
>    DaemonPort = " (number->string port) "
> -" extra-settings))))
> +  PluginDir = " (bitlbee-plugin-directory plugins) "/lib/bitlbee

I think you could inline the ‘directory-union’ call here; no need to
define ‘bitlbee-plugin-directory’.

> @@ -860,6 +868,7 @@ a gateway between IRC and chat networks.")))
>  
>  (define* (bitlbee-service #:key (bitlbee bitlbee) ;deprecated
>                            (interface "127.0.0.1") (port 6667)
> +                          (plugins '())
>                            (extra-settings ""))

You can omit this bit because this procedure is deprecated.

Could you send an updated patch?

Thank you!

Ludo’.