diff options
Diffstat (limited to 'gnu/services')
-rw-r--r-- | gnu/services/base.scm | 10 | ||||
-rw-r--r-- | gnu/services/desktop.scm | 93 | ||||
-rw-r--r-- | gnu/services/xorg.scm | 9 |
3 files changed, 85 insertions, 27 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 6160e79f30..9b3dc73831 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -80,6 +80,7 @@ nscd-service-type nscd-service syslog-service + %default-syslog.conf guix-configuration guix-configuration? @@ -804,9 +805,12 @@ Service Switch}, for an example." ")) (define* (syslog-service #:key (config-file %default-syslog.conf)) - "Return a service that runs @code{syslogd}. -If configuration file name @var{config-file} is not specified, use some -reasonable default settings." + "Return a service that runs @command{syslogd}. If configuration file +name @var{config-file} is not specified, use some reasonable default +settings. + +@xref{syslogd invocation,,, inetutils, GNU Inetutils}, for more +information on the configuration file syntax." (service syslog-service-type config-file)) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 02bcf1b19f..f427d35777 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -32,6 +32,7 @@ #:use-module (gnu packages admin) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gnome) + #:use-module (gnu packages xfce) #:use-module (gnu packages avahi) #:use-module (gnu packages polkit) #:use-module (gnu packages xdisorg) @@ -51,6 +52,8 @@ polkit-service elogind-configuration elogind-service + gnome-desktop-service + xfce-desktop-service %desktop-services)) ;;; Commentary: @@ -67,6 +70,11 @@ (define (bool value) (if value "true\n" "false\n")) +(define (package-direct-input-selector input) + (lambda (package) + (match (assoc-ref (package-direct-inputs package) input) + ((package . _) package)))) + (define (wrapped-dbus-service service program variable value) "Return a wrapper for @var{service}, a package containing a D-Bus service, @@ -647,22 +655,11 @@ include the @command{udisksctl} command, part of UDisks, and GNOME Disks." ("HybridSleepState" (sleep-list elogind-hybrid-sleep-state)) ("HybridSleepMode" (sleep-list elogind-hybrid-sleep-mode)))) -(define (elogind-shepherd-service config) - "Return a shepherd service for elogind, using @var{config}." - ;; TODO: We could probably rely on service activation but the '.service' - ;; file currently contains an erroneous 'Exec' line. - (let ((config-file (elogind-configuration-file config)) - (elogind (elogind-package config))) - (list (shepherd-service - (documentation "Run the elogind login and seat management service.") - (provision '(elogind)) - (requirement '(dbus-system)) - - (start #~(make-forkexec-constructor - (list (string-append #$elogind "/libexec/elogind/elogind")) - #:environment-variables - (list (string-append "ELOGIND_CONF_FILE=" #$config-file)))) - (stop #~(make-kill-destructor)))))) +(define (elogind-dbus-service config) + (list (wrapped-dbus-service (elogind-package config) + "libexec/elogind/elogind" + "ELOGIND_CONF_FILE" + (elogind-configuration-file config)))) (define (pam-extension-procedure config) "Return an extension for PAM-ROOT-SERVICE-TYPE that ensures that all the PAM @@ -683,10 +680,8 @@ seats.)" (define elogind-service-type (service-type (name 'elogind) (extensions - (list (service-extension shepherd-root-service-type - elogind-shepherd-service) - (service-extension dbus-root-service-type - (compose list elogind-package)) + (list (service-extension dbus-root-service-type + elogind-dbus-service) (service-extension udev-service-type (compose list elogind-package)) (service-extension polkit-service-type @@ -710,6 +705,64 @@ when they log out." ;;; +;;; GNOME desktop service. +;;; + +(define-record-type* <gnome-desktop-configuration> gnome-desktop-configuration + make-gnome-desktop-configuration + gnome-desktop-configuration + (gnome-package gnome-package (default gnome))) + +(define gnome-desktop-service-type + (service-type + (name 'gnome-desktop) + (extensions + (list (service-extension polkit-service-type + (compose list + (package-direct-input-selector + "gnome-settings-daemon") + gnome-package)) + (service-extension profile-service-type + (compose list + gnome-package)))))) + +(define* (gnome-desktop-service #:key (config (gnome-desktop-configuration))) + "Return a service that adds the @code{gnome} package to the system profile, +and extends polkit with the actions from @code{gnome-settings-daemon}." + (service gnome-desktop-service-type config)) + + +;;; +;;; XFCE desktop service. +;;; + +(define-record-type* <xfce-desktop-configuration> xfce-desktop-configuration + make-xfce-desktop-configuration + xfce-desktop-configuration + (xfce xfce-package (default xfce))) + +(define xfce-desktop-service-type + (service-type + (name 'xfce-desktop) + (extensions + (list (service-extension polkit-service-type + (compose list + (package-direct-input-selector + "thunar") + xfce-package)) + (service-extension profile-service-type + (compose list + xfce-package)))))) + +(define* (xfce-desktop-service #:key (config (xfce-desktop-configuration))) + "Return a service that adds the @code{xfce} package to the system profile, +and extends polkit with the abilit for @code{thunar} to manipulate the file +system as root from within a user session, after the user has authenticated +with the administrator's password." + (service xfce-desktop-service-type config)) + + +;;; ;;; The default set of desktop services. ;;; diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 980b5a6ba5..e16247b3b8 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; ;;; This file is part of GNU Guix. @@ -246,13 +246,14 @@ which should be passed to this script as the first argument. If not, the (let* ((home (getenv "HOME")) (xsession-file (string-append home "/.xsession")) (session (match (command-line) - ((_ x) x) - (_ #$fallback-session)))) + ((_) (list #$fallback-session)) + ((_ x ..1) x)))) (if (file-exists? xsession-file) ;; Run ~/.xsession when it exists. (exec-from-login-shell xsession-file session) ;; Otherwise, start the specified session. - (exec-from-login-shell session))))) + (apply exec-from-login-shell session))))) + (program-file "xinitrc" builder)) |