@@ -25,6 +25,7 @@ (define-module (gnu home services shepherd-xyz)
#:use-module (gnu home services)
#:use-module (gnu home services shepherd)
+ #:use-module (gnu packages messaging)
#:use-module (gnu packages ssh)
#:use-module (gnu packages version-control)
#:use-module (gnu services configuration)
@@ -35,7 +36,9 @@ (define-module (gnu home services shepherd-xyz)
#:export (home-git-daemon-configuration
home-git-daemon-service-type
home-ssh-agent-configuration
- home-ssh-agent-service-type))
+ home-ssh-agent-service-type
+ home-znc-configuration
+ home-znc-service-type))
;;; Commentary:
;;
@@ -178,3 +181,41 @@ (define home-ssh-agent-service-type
home-ssh-agent-services)))
(description
"Install and configure the ssh-agent as a shepherd service.")))
+
+
+;;;
+;;; Znc.
+;;;
+(define-record-type* <home-znc-configuration>
+ home-znc-configuration make-home-znc-configuration
+ home-znc-configuration?
+ (znc home-znc-znc ;string
+ (default znc))
+ (extra-options home-znc-extra-options ;list of string
+ (default '())))
+
+(define (home-znc-services config)
+ "Return a <shepherd-service> for znc with CONFIG."
+ (match config
+ (($ <home-znc-configuration> znc extra-options)
+ (let* ((znc (file-append znc "/bin/znc"))
+ (command `(,znc
+ "--foreground"
+ ,@extra-options))
+ (log-file (string-append %user-log-dir "/znc.log")))
+ (list (shepherd-service
+ (documentation "Run the znc IRC bouncer.")
+ (provision '(znc))
+ (start #~(make-forkexec-constructor '#$command
+ #:log-file #$log-file))
+ (stop #~(make-kill-destructor))))))))
+
+(define home-znc-service-type
+ (service-type
+ (name 'home-znc)
+ (default-value (home-znc-configuration))
+ (extensions
+ (list (service-extension home-shepherd-service-type
+ home-znc-services)))
+ (description
+ "Install and configure znc as a shepherd service.")))