aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-09-23 23:46:01 +0200
committerLudovic Courtès <ludo@gnu.org>2014-09-23 23:46:01 +0200
commit4627a4647018fa8d5c2fa4ec60971497583f8606 (patch)
tree557d9299a4c79f7e8c7ca4903525a8ac45fe82e2
parentb5d9beaa1a0092f2751d83154e754a422b925fb4 (diff)
downloadpatches-4627a4647018fa8d5c2fa4ec60971497583f8606.tar
patches-4627a4647018fa8d5c2fa4ec60971497583f8606.tar.gz
services: Add 'bitlbee-service'.
* gnu/services/networking.scm (bitlbee-service): New procedure. * doc/guix.texi (Networking Services): Document it.
-rw-r--r--doc/guix.texi17
-rw-r--r--gnu/services/networking.scm43
2 files changed, 58 insertions, 2 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 51884c3c6f..a63602162d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3532,7 +3532,22 @@ The daemon runs with the default settings (in particular the default exit
policy) as the @code{tor} unprivileged user.
@end deffn
-In addition, @code{(gnu system ssh)} provides the following service.
+@deffn {Monadic Procedure} bitlbee-service [#:bitlbee bitlbee] @
+ [#:interface "127.0.0.1"] [#:port 6667] @
+ [#:extra-settings ""]
+Return a service that runs @url{http://bitlbee.org,BitlBee}, a daemon that
+acts as a gateway between IRC and chat networks.
+
+The daemon will listen to the interface corresponding to the IP address
+specified in @var{interface}, on @var{port}. @code{127.0.0.1} means that only
+local clients can connect, whereas @code{0.0.0.0} means that connections can
+come from any networking interface.
+
+In addition, @var{extra-settings} specifies a string to append to the
+configuration file.
+@end deffn
+
+Furthermore, @code{(gnu system ssh)} provides the following service.
@deffn {Monadic Procedure} lsh-service [#:host-key "/etc/lsh/host-key"] @
[#:interfaces '()] [#:port-number 22] @
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index d532fc8d99..44e3c303de 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -22,11 +22,13 @@
#:use-module (gnu packages admin)
#:use-module (gnu packages linux)
#:use-module (gnu packages tor)
+ #:use-module (gnu packages messaging)
#:use-module (guix gexp)
#:use-module (guix monads)
#:export (static-networking-service
dhcp-client-service
- tor-service))
+ tor-service
+ bitlbee-service))
;;; Commentary:
;;;
@@ -166,4 +168,43 @@ policy) as the @code{tor} unprivileged user."
(documentation "Run the Tor anonymous network overlay.")))))
+(define* (bitlbee-service #:key (bitlbee bitlbee)
+ (interface "127.0.0.1") (port 6667)
+ (extra-settings ""))
+ "Return a service that runs @url{http://bitlbee.org,BitlBee}, a daemon that
+acts as a gateway between IRC and chat networks.
+
+The daemon will listen to the interface corresponding to the IP address
+specified in @var{interface}, on @var{port}. @code{127.0.0.1} means that only
+local clients can connect, whereas @code{0.0.0.0} means that connections can
+come from any networking interface.
+
+In addition, @var{extra-settings} specifies a string to append to the
+configuration file."
+ (mlet %store-monad ((conf (text-file "bitlbee.conf"
+ (string-append "
+ [settings]
+ User = bitlbee
+ ConfigDir = /var/lib/bitlbee
+ DaemonInterface = " interface "
+ DaemonPort = " (number->string port) "
+" extra-settings))))
+ (return
+ (service
+ (provision '(bitlbee))
+ (requirement '(user-processes loopback))
+ (start #~(make-forkexec-constructor
+ (list (string-append #$bitlbee "/sbin/bitlbee")
+ "-n" "-F" "-u" "bitlbee" "-c" #$conf)))
+ (stop #~(make-kill-destructor))
+ (user-groups (list (user-group (name "bitlbee") (system? #t))))
+ (user-accounts (list (user-account
+ (name "bitlbee")
+ (group "bitlbee")
+ (system? #t)
+ (comment "BitlBee daemon user")
+ (home-directory "/var/empty")
+ (shell #~(string-append #$shadow
+ "/sbin/nologin")))))))))
+
;;; networking.scm ends here