;;; 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.
;;;
(define-module (gnu services web)
#:use-module (gnu services)
- #:use-module (gnu services dmd)
+ #:use-module (gnu services shepherd)
#:use-module (gnu system shadow)
#:use-module (gnu packages admin)
#:use-module (gnu packages web)
#: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:
;;;
(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 _
(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