aboutsummaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-06-29 22:51:23 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-06-29 22:51:23 +0200
commitf1728d43460e63b106dd446e70001d8e100eaf6d (patch)
tree9d211fabf9e200743be49e25d108d58ed88d2f60 /gnu/services
parentcda7f4bc8ecf331d623c7d37b01931a46830c648 (diff)
parent373cc3b74a6ad33fddf75c2d773a97b1775bda8e (diff)
downloadguix-f1728d43460e63b106dd446e70001d8e100eaf6d.tar
guix-f1728d43460e63b106dd446e70001d8e100eaf6d.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/authentication.scm41
-rw-r--r--gnu/services/base.scm5
-rw-r--r--gnu/services/cuirass.scm7
-rw-r--r--gnu/services/cups.scm5
-rw-r--r--gnu/services/dns.scm16
-rw-r--r--gnu/services/networking.scm6
-rw-r--r--gnu/services/pm.scm2
-rw-r--r--gnu/services/shepherd.scm40
-rw-r--r--gnu/services/sound.scm34
-rw-r--r--gnu/services/web.scm9
10 files changed, 118 insertions, 47 deletions
diff --git a/gnu/services/authentication.scm b/gnu/services/authentication.scm
new file mode 100644
index 0000000000..1a2629d475
--- /dev/null
+++ b/gnu/services/authentication.scm
@@ -0,0 +1,41 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu services authentication)
+ #:use-module (gnu services)
+ #:use-module (gnu services dbus)
+ #:use-module (gnu packages freedesktop)
+ #:use-module (guix gexp)
+ #:use-module (guix records)
+ #:export (fprintd-configuration
+ fprintd-configuration?
+ fprintd-service-type))
+
+(define-record-type* <fprintd-configuration>
+ fprintd-configuration make-fprintd-configuration
+ fprintd-configuration?
+ (ntp fprintd-configuration-fprintd
+ (default fprintd)))
+
+(define fprintd-service-type
+ (service-type (name 'fprintd)
+ (extensions
+ (list (service-extension dbus-root-service-type
+ list)))
+ (description
+ "Run fprintd, a fingerprint management daemon.")))
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index b34bb7132b..68411439db 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1592,8 +1592,9 @@ failed to register hydra.gnu.org public key: ~a~%" status))))))))
(call-with-output-file #$output
(lambda (port)
- (write (call-with-input-file "graph"
- read-reference-graph)
+ (write (map store-info-item
+ (call-with-input-file "graph"
+ read-reference-graph))
port)))))
#:options `(#:local-build? #f
#:references-graphs (("graph" ,item))))
diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm
index c5e9fcbb22..4664a36dcf 100644
--- a/gnu/services/cuirass.scm
+++ b/gnu/services/cuirass.scm
@@ -3,10 +3,11 @@
;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
-;;; GNU Guix is free software: you can redistribute it and/or modify
+;;; GNU Guix is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
@@ -172,5 +173,7 @@
(service-extension rottlog-service-type cuirass-log-rotations)
(service-extension activation-service-type cuirass-activation)
(service-extension shepherd-root-service-type cuirass-shepherd-service)
- (service-extension account-service-type cuirass-account)))))
+ (service-extension account-service-type cuirass-account)))
+ (description
+ "Run the Cuirass continuous integration service.")))
diff --git a/gnu/services/cups.scm b/gnu/services/cups.scm
index 4c62e6a6f7..715d333a71 100644
--- a/gnu/services/cups.scm
+++ b/gnu/services/cups.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Andy Wingo <wingo@pobox.com>
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1024,7 +1025,9 @@ extensions that it uses."
(append (opaque-cups-configuration-extensions config)
extensions)))))))
- (default-value (cups-configuration))))
+ (default-value (cups-configuration))
+ (description
+ "Run the CUPS print server.")))
;; A little helper to make it easier to document all those fields.
(define (generate-cups-documentation)
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
index d0913e90ed..2c57a36b84 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -622,8 +622,8 @@
(default '())) ;list of string
(cache-size dnsmasq-configuration-cache-size
(default 150)) ;integer
- (no-negcache? dnsmasq-configuration-no-negcache?
- (default #f))) ;boolean
+ (negative-cache? dnsmasq-configuration-negative-cache?
+ (default #t))) ;boolean
(define dnsmasq-shepherd-service
(match-lambda
@@ -631,7 +631,7 @@
no-hosts?
port local-service? listen-addresses
resolv-file no-resolv? servers
- cache-size no-negcache?)
+ cache-size negative-cache?)
(shepherd-service
(provision '(dnsmasq))
(requirement '(networking))
@@ -656,9 +656,9 @@
#$@(map (cut format #f "--server=~a" <>)
servers)
#$(format #f "--cache-size=~a" cache-size)
- #$@(if no-negcache?
- '("--no-negcache")
- '()))
+ #$@(if negative-cache?
+ '()
+ '("--no-negcache")))
#:pid-file "/run/dnsmasq.pid"))
(stop #~(make-kill-destructor))))))
@@ -667,4 +667,6 @@
(name 'dnsmasq)
(extensions
(list (service-extension shepherd-root-service-type
- (compose list dnsmasq-shepherd-service))))))
+ (compose list dnsmasq-shepherd-service))))
+ (default-value (dnsmasq-configuration))
+ (description "Run the dnsmasq DNS server.")))
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index e4441f6475..d5d0cf9d1d 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -608,7 +609,7 @@ demand.")))
(call-with-output-file #$output
(lambda (port)
(display "\
-# The beginning was automatically added.
+### These lines were generated from your system configuration:
User tor
DataDirectory /var/lib/tor
Log notice syslog\n" port)
@@ -628,6 +629,9 @@ HiddenServicePort ~a ~a~%"
(cons name mapping)))
services))
+ (display "\
+### End of automatically generated lines.\n\n" port)
+
;; Append the user's config file.
(call-with-input-file #$config-file
(lambda (input)
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index d40cb993e2..3817bd09de 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -3,7 +3,7 @@
;;;
;;; This file is part of GNU Guix.
;;;
-;;; GNU Guix is free software: you can redistribute it and/or modify
+;;; GNU Guix is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 000e85eb86..6ca53faa3d 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -22,7 +22,6 @@
#:use-module (guix sets)
#:use-module (guix gexp)
#:use-module (guix store)
- #:use-module (guix monads)
#:use-module (guix records)
#:use-module (guix derivations) ;imported-modules, etc.
#:use-module (gnu services)
@@ -66,26 +65,25 @@
(define (shepherd-boot-gexp services)
- (with-monad %store-monad
- (return #~(begin
- ;; Keep track of the booted system.
- (false-if-exception (delete-file "/run/booted-system"))
- (symlink (readlink "/run/current-system")
- "/run/booted-system")
-
- ;; Close any remaining open file descriptors to be on the safe
- ;; side. This must be the very last thing we do, because
- ;; Guile has internal FDs such as 'sleep_pipe' that need to be
- ;; alive.
- (let loop ((fd 3))
- (when (< fd 1024)
- (false-if-exception (close-fdes fd))
- (loop (+ 1 fd))))
-
- ;; Start shepherd.
- (execl #$(file-append shepherd "/bin/shepherd")
- "shepherd" "--config"
- #$(shepherd-configuration-file services))))))
+ #~(begin
+ ;; Keep track of the booted system.
+ (false-if-exception (delete-file "/run/booted-system"))
+ (symlink (readlink "/run/current-system")
+ "/run/booted-system")
+
+ ;; Close any remaining open file descriptors to be on the safe
+ ;; side. This must be the very last thing we do, because
+ ;; Guile has internal FDs such as 'sleep_pipe' that need to be
+ ;; alive.
+ (let loop ((fd 3))
+ (when (< fd 1024)
+ (false-if-exception (close-fdes fd))
+ (loop (+ 1 fd))))
+
+ ;; Start shepherd.
+ (execl #$(file-append shepherd "/bin/shepherd")
+ "shepherd" "--config"
+ #$(shepherd-configuration-file services))))
(define shepherd-root-service-type
(service-type
diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm
index 5fe555e8b6..f2dd24402f 100644
--- a/gnu/services/sound.scm
+++ b/gnu/services/sound.scm
@@ -26,6 +26,7 @@
#:use-module (guix packages)
#:use-module (guix records)
#:use-module (guix store)
+ #:use-module (gnu packages linux)
#:use-module (gnu packages pulseaudio)
#:use-module (ice-9 match)
#:export (alsa-configuration
@@ -44,17 +45,31 @@
(define-record-type* <alsa-configuration>
alsa-configuration make-alsa-configuration alsa-configuration?
+ (alsa-plugins alsa-configuration-alsa-plugins ;<package>
+ (default alsa-plugins))
(pulseaudio? alsa-configuration-pulseaudio? ;boolean
(default #t))
(extra-options alsa-configuration-extra-options ;string
(default "")))
-(define (alsa-config-file config)
- "Return the ALSA configuration file corresponding to CONFIG."
- (plain-file "asound.conf"
- (string-append "# Generated by 'alsa-service'.\n\n"
- (if (alsa-configuration-pulseaudio? config)
- "# Use PulseAudio by default
+(define alsa-config-file
+ ;; Return the ALSA configuration file.
+ (match-lambda
+ (($ <alsa-configuration> alsa-plugins pulseaudio? extra-options)
+ (apply mixed-text-file "asound.conf"
+ `("# Generated by 'alsa-service'.\n\n"
+ ,@(if pulseaudio?
+ `("# Use PulseAudio by default
+pcm_type.pulse {
+ lib \"" ,#~(string-append #$alsa-plugins:pulseaudio
+ "/lib/alsa-lib/libasound_module_pcm_pulse.so") "\"
+}
+
+ctl_type.pulse {
+ lib \"" ,#~(string-append #$alsa-plugins:pulseaudio
+ "/lib/alsa-lib/libasound_module_ctl_pulse.so") "\"
+}
+
pcm.!default {
type pulse
fallback \"sysdefault\"
@@ -67,10 +82,9 @@ pcm.!default {
ctl.!default {
type pulse
fallback \"sysdefault\"
-}
-"
- "")
- (alsa-configuration-extra-options config))))
+}\n\n")
+ '())
+ ,extra-options)))))
(define (alsa-etc-service config)
(list `("asound.conf" ,(alsa-config-file config))))
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index aae2f3db0d..9a58eff5ef 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -77,6 +77,7 @@
nginx-configuration-upstream-blocks
nginx-configuration-server-names-hash-bucket-size
nginx-configuration-server-names-hash-bucket-max-size
+ nginx-configuration-extra-content
nginx-configuration-file
<nginx-server-configuration>
@@ -431,6 +432,8 @@
(default #f))
(server-names-hash-bucket-max-size nginx-configuration-server-names-hash-bucket-max-size
(default #f))
+ (extra-content nginx-configuration-extra-content
+ (default ""))
(file nginx-configuration-file ;#f | string | file-like
(default #f)))
@@ -521,7 +524,8 @@ of index files."
(nginx log-directory run-directory
server-blocks upstream-blocks
server-names-hash-bucket-size
- server-names-hash-bucket-max-size)
+ server-names-hash-bucket-max-size
+ extra-content)
(apply mixed-text-file "nginx.conf"
(flatten
"user nginx nginx;\n"
@@ -550,7 +554,8 @@ of index files."
"\n"
(map emit-nginx-upstream-config upstream-blocks)
(map emit-nginx-server-config server-blocks)
- "}\n"
+ extra-content
+ "\n}\n"
"events {}\n"))))
(define %nginx-accounts