services: rottlog: Add Rottlog to the global profile.
[jackhill/guix/guix.git] / gnu / services / web.scm
index bc0aa62..0a2a09b 100644 (file)
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
-;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module (ice-9 match)
-  #:export (nginx-service))
+  #:export (nginx-configuration
+            nginx-configuration?
+            nginx-service
+            nginx-service-type))
 
 ;;; Commentary:
 ;;;
@@ -63,7 +67,7 @@
          (system? #t)
          (comment "nginx server user")
          (home-directory "/var/empty")
-         (shell #~(string-append #$shadow "/sbin/nologin")))))
+         (shell (file-append shadow "/sbin/nologin")))))
 
 (define nginx-activation
   (match-lambda
          (format #t "creating nginx run directory '~a'~%" #$run-directory)
          (mkdir-p #$run-directory)
          ;; Check configuration file syntax.
-         (system* (string-append #$nginx "/bin/nginx")
+         (system* (string-append #$nginx "/sbin/nginx")
                   "-c" #$config-file "-t")))))
 
-(define nginx-dmd-service
+(define nginx-shepherd-service
   (match-lambda
     (($ <nginx-configuration> nginx log-directory run-directory config-file)
-     (let* ((nginx-binary #~(string-append #$nginx "/sbin/nginx"))
+     (let* ((nginx-binary (file-append nginx "/sbin/nginx"))
             (nginx-action
              (lambda args
                #~(lambda _
@@ -90,7 +94,7 @@
                     (system* #$nginx-binary "-c" #$config-file #$@args))))))
 
        ;; TODO: Add 'reload' action.
-       (list (dmd-service
+       (list (shepherd-service
               (provision '(nginx))
               (documentation "Run the nginx daemon.")
               (requirement '(user-processes loopback))
 (define nginx-service-type
   (service-type (name 'nginx)
                 (extensions
-                 (list (service-extension dmd-root-service-type
-                                          nginx-dmd-service)
+                 (list (service-extension shepherd-root-service-type
+                                          nginx-shepherd-service)
                        (service-extension activation-service-type
                                           nginx-activation)
                        (service-extension account-service-type
                          (default-nginx-config log-directory run-directory)))
   "Return a service that runs NGINX, the nginx web server.
 
-The nginx daemon loads its runtime configuration from CONFIG-FIGLE, stores log
+The nginx daemon loads its runtime configuration from CONFIG-FILE, stores log
 files in LOG-DIRECTORY, and stores temporary runtime files in RUN-DIRECTORY."
   (service nginx-service-type
            (nginx-configuration