diff options
author | Marius Bakke <marius@gnu.org> | 2020-11-15 23:45:34 +0100 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2020-11-15 23:45:34 +0100 |
commit | 4e5e05d40908e9f1336ffc5a6c4928ab61ad034c (patch) | |
tree | ad6d6be0ece396ba3353871a5691e514253508f8 /gnu/services | |
parent | 2c400ae94207b3b84fcdcaa21c122076c050d307 (diff) | |
parent | e1fa3ea9fe8d01dd124c5e304bde9243876378ba (diff) | |
download | guix-patches-4e5e05d40908e9f1336ffc5a6c4928ab61ad034c.tar guix-patches-4e5e05d40908e9f1336ffc5a6c4928ab61ad034c.tar.gz |
Merge branch 'master' into staging
Diffstat (limited to 'gnu/services')
-rw-r--r-- | gnu/services/audio.scm | 33 | ||||
-rw-r--r-- | gnu/services/base.scm | 28 | ||||
-rw-r--r-- | gnu/services/web.scm | 9 |
3 files changed, 51 insertions, 19 deletions
diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm index 37f2efa479..627b941871 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com> ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +22,8 @@ #:use-module (guix gexp) #:use-module (gnu services) #:use-module (gnu services shepherd) + #:use-module (gnu system shadow) + #:use-module (gnu packages admin) #:use-module (gnu packages mpd) #:use-module (guix records) #:use-module (ice-9 match) @@ -135,19 +138,19 @@ audio_output { (define (mpd-shepherd-service config) (shepherd-service (documentation "Run the MPD (Music Player Daemon)") + (requirement '(user-processes)) (provision '(mpd)) (start #~(make-forkexec-constructor (list #$(file-append mpd "/bin/mpd") "--no-daemon" #$(mpd-config->file config)) - #:pid-file #$(mpd-file-name config "pid") #:environment-variables ;; Required to detect PulseAudio when run under a user account. - '(#$(string-append - "XDG_RUNTIME_DIR=/run/user/" - (number->string + (list (string-append + "XDG_RUNTIME_DIR=/run/user/" + (number->string (passwd:uid - (getpwnam (mpd-configuration-user config)))))) + (getpwnam #$(mpd-configuration-user config)))))) #:log-file #$(mpd-file-name config "log"))) (stop #~(make-kill-destructor)))) @@ -158,10 +161,26 @@ audio_output { (define %user (getpw #$(mpd-configuration-user config))) - (let ((directory #$(mpd-file-name config ""))) + (let ((directory #$(mpd-file-name config ".mpd"))) (mkdir-p directory) (chown directory (passwd:uid %user) (passwd:gid %user)))))) + +(define %mpd-accounts + ;; Default account and group for MPD. + (list (user-group (name "mpd") (system? #t)) + (user-account + (name "mpd") + (group "mpd") + (system? #t) + (comment "Music Player Daemon (MPD) user") + + ;; Note: /var/run/mpd hosts one sub-directory per user, of which + ;; /var/run/mpd/mpd corresponds to the "mpd" user. + (home-directory "/var/run/mpd/mpd") + + (shell (file-append shadow "/sbin/nologin"))))) + (define mpd-service-type (service-type (name 'mpd) @@ -169,6 +188,8 @@ audio_output { (extensions (list (service-extension shepherd-root-service-type (compose list mpd-shepherd-service)) + (service-extension account-service-type + (const %mpd-accounts)) (service-extension activation-service-type mpd-service-activation))) (default-value (mpd-configuration)))) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 499e50bfd7..416bc02a96 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com> -;;; Copyright © 2015, 2016 Mark H Weaver <mhw@netris.org> +;;; Copyright © 2015, 2016, 2020 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name> ;;; Copyright © 2016 David Craven <david@craven.ch> @@ -1024,20 +1024,22 @@ the tty to run, among other things." (define-record-type* <mingetty-configuration> mingetty-configuration make-mingetty-configuration mingetty-configuration? - (mingetty mingetty-configuration-mingetty ;<package> - (default mingetty)) - (tty mingetty-configuration-tty) ;string - (auto-login mingetty-auto-login ;string | #f - (default #f)) - (login-program mingetty-login-program ;gexp - (default #f)) - (login-pause? mingetty-login-pause? ;Boolean - (default #f))) + (mingetty mingetty-configuration-mingetty ;<package> + (default mingetty)) + (tty mingetty-configuration-tty) ;string + (auto-login mingetty-auto-login ;string | #f + (default #f)) + (login-program mingetty-login-program ;gexp + (default #f)) + (login-pause? mingetty-login-pause? ;Boolean + (default #f)) + (clear-on-logout? mingetty-clear-on-logout? ;Boolean + (default #t))) (define mingetty-shepherd-service (match-lambda (($ <mingetty-configuration> mingetty tty auto-login login-program - login-pause?) + login-pause? clear-on-logout?) (list (shepherd-service (documentation "Run mingetty on an tty.") @@ -1050,7 +1052,6 @@ the tty to run, among other things." (start #~(make-forkexec-constructor (list #$(file-append mingetty "/sbin/mingetty") - "--noclear" ;; Avoiding 'vhangup' allows us to avoid 'setfont' ;; errors down the path where various ioctls get @@ -1058,6 +1059,9 @@ the tty to run, among other things." ;; in Linux. "--nohangup" #$tty + #$@(if clear-on-logout? + #~() + #~("--noclear")) #$@(if auto-login #~("--autologin" #$auto-login) #~()) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 53858436fa..855f4e649b 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -256,7 +256,14 @@ mumi-configuration-sender mumi-configuration-smtp - mumi-service-type)) + mumi-service-type + + gmnisrv-configuration + gmnisrv-configuration? + gmnisrv-configuration-package + gmnisrv-configuration-config-file + + gmnisrv-service-type)) ;;; Commentary: ;;; |