From 96c7b4c846214a9f04480fc1a5be37ac5c42744e Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 29 Jan 2019 10:03:12 +0000 Subject: services: Add cups-pk-helper. This service integrates cups and PolicyKit. The gnome-control-center printing section uses this functionality. * gnu/sevices/desktop.scm (cups-pk-helper-service-type): New variable. (%desktop-services): Add the cups-pk-helper service. --- gnu/services/desktop.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gnu/services') diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index fbeabf1162..a93fa3c356 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -39,6 +39,7 @@ #:use-module (gnu system pam) #:use-module (gnu packages glib) #:use-module (gnu packages admin) + #:use-module (gnu packages cups) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gnome) #:use-module (gnu packages xfce) @@ -800,6 +801,21 @@ acquire the capability to modify their system configuration. accountsservice web site} for more information." (service accountsservice-service-type accountsservice)) + +;;; +;;; cups-pk-helper service. +;;; + +(define cups-pk-helper-service-type + (service-type + (name 'cups-pk-helper) + (description + "PolicyKit helper to configure CUPS with fine-grained privileges.") + (extensions + (list (service-extension dbus-root-service-type list) + (service-extension polkit-service-type list))) + (default-value cups-pk-helper))) + ;;; ;;; GNOME desktop service. @@ -990,6 +1006,7 @@ as expected."))) (udisks-service) (upower-service) (accountsservice-service) + (service cups-pk-helper-service-type) (colord-service) (geoclue-service) (service polkit-service-type) -- cgit v1.2.3 From 6b692e961c423c4d13497f6c5466ac230b063265 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 29 Jan 2019 14:49:01 +0000 Subject: services: Improve the upower-configuration record. Copy the defaults from the upower-service procedure to the record type. This will allow making it the default value for the upower-service-type, and deprecating the procedure. Export the field accessors so that the record type becomes more usable. * gnu/services/desktop.scm (): Export it. (upower-configuration-upower, upower-configuration-watts-up-pro?, upower-configuration-poll-batteries?, upower-configuration-ignore-lid?, upower-configuration-use-percentage-for-policy?, upower-configuration-percentage-low, upower-configuration-percentage-critical, upower-configuration-percentage-action, upower-configuration-time-low, upower-configuration-time-critical, upower-configuration-time-action, upower-configuration-critical-power-action): Add default and export. --- gnu/services/desktop.scm | 55 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 15 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index a93fa3c356..df6764d278 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2017 Nils Gillmann ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2018 Ricardo Wurmus +;;; Copyright © 2017, 2019 Christopher Baines ;;; ;;; This file is part of GNU Guix. ;;; @@ -57,8 +58,22 @@ #:use-module (guix gexp) #:use-module (srfi srfi-1) #:use-module (ice-9 match) - #:export (upower-configuration + #:export ( + upower-configuration upower-configuration? + upower-configuration-upower + upower-configuration-watts-up-pro? + upower-configuration-poll-batteries? + upower-configuration-ignore-lid? + upower-configuration-use-percentage-for-policy? + upower-configuration-percentage-low + upower-configuration-percentage-critical + upower-configuration-percentage-action + upower-configuration-time-low + upower-configuration-time-critical + upower-configuration-time-action + upower-configuration-critical-power-action + upower-service upower-service-type @@ -174,23 +189,33 @@ is set to @var{value} when the bus daemon launches it." ;;; Upower D-Bus service. ;;; -;; TODO: Export. (define-record-type* upower-configuration make-upower-configuration upower-configuration? - (upower upower-configuration-upower - (default upower)) - (watts-up-pro? upower-configuration-watts-up-pro?) - (poll-batteries? upower-configuration-poll-batteries?) - (ignore-lid? upower-configuration-ignore-lid?) - (use-percentage-for-policy? upower-configuration-use-percentage-for-policy?) - (percentage-low upower-configuration-percentage-low) - (percentage-critical upower-configuration-percentage-critical) - (percentage-action upower-configuration-percentage-action) - (time-low upower-configuration-time-low) - (time-critical upower-configuration-time-critical) - (time-action upower-configuration-time-action) - (critical-power-action upower-configuration-critical-power-action)) + (upower upower-configuration-upower + (default upower)) + (watts-up-pro? upower-configuration-watts-up-pro? + (default #f)) + (poll-batteries? upower-configuration-poll-batteries? + (default #t)) + (ignore-lid? upower-configuration-ignore-lid? + (default #f)) + (use-percentage-for-policy? upower-configuration-use-percentage-for-policy? + (default #f)) + (percentage-low upower-configuration-percentage-low + (default 10)) + (percentage-critical upower-configuration-percentage-critical + (default 3)) + (percentage-action upower-configuration-percentage-action + (default 2)) + (time-low upower-configuration-time-low + (default 1200)) + (time-critical upower-configuration-time-critical + (default 300)) + (time-action upower-configuration-time-action + (default 120)) + (critical-power-action upower-configuration-critical-power-action + (default 'hybrid-sleep))) (define* upower-configuration-file ;; Return an upower-daemon configuration file. -- cgit v1.2.3 From 8b9a7b26c290228223829f842240f3675a87da7b Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 29 Jan 2019 15:14:15 +0000 Subject: services: Improve the upower-service-type. Add a description and default value. Switch the documentation to mention the service-type and the configuration record, rather than the upower-service procedure. * gnu/services/desktop.scm (upower-service-type)[description, default-value]: Define these fields. (%desktop-services): Change (upower-service) to (service upower-service-type). * doc/guix.texi (Desktop Services): Update the upower service documentation. --- doc/guix.texi | 92 ++++++++++++++++++++++++++++++++++++++---------- gnu/services/desktop.scm | 10 ++++-- 2 files changed, 82 insertions(+), 20 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 68d39ed02f..ddd3adf825 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34,6 +34,7 @@ Copyright @copyright{} 2016, 2017 Nils Gillmann@* Copyright @copyright{} 2016, 2017, 2018 Jan Nieuwenhuizen@* Copyright @copyright{} 2016 Julien Lepiller@* Copyright @copyright{} 2016 Alex ter Weele@* +Copyright @copyright{} 2016, 2017, 2018, 2019 Christopher Baines@* Copyright @copyright{} 2017, 2018 Clément Lassieur@* Copyright @copyright{} 2017, 2018 Mathieu Othacehe@* Copyright @copyright{} 2017 Federico Beffa@* @@ -14291,24 +14292,79 @@ capabilities to ordinary users. For example, an ordinary user can be granted the capability to suspend the system if the user is logged in locally. @end deffn -@deffn {Scheme Procedure} upower-service [#:upower @var{upower}] @ - [#:watts-up-pro? #f] @ - [#:poll-batteries? #t] @ - [#:ignore-lid? #f] @ - [#:use-percentage-for-policy? #f] @ - [#:percentage-low 10] @ - [#:percentage-critical 3] @ - [#:percentage-action 2] @ - [#:time-low 1200] @ - [#:time-critical 300] @ - [#:time-action 120] @ - [#:critical-power-action 'hybrid-sleep] -Return a service that runs @uref{http://upower.freedesktop.org/, -@command{upowerd}}, a system-wide monitor for power consumption and battery -levels, with the given configuration settings. It implements the -@code{org.freedesktop.UPower} D-Bus interface, and is notably used by -GNOME. -@end deffn +@defvr {Scheme Variable} upower-service-type +Service that runs @uref{http://upower.freedesktop.org/, @command{upowerd}}, a +system-wide monitor for power consumption and battery levels, with the given +configuration settings. + +It implements the @code{org.freedesktop.UPower} D-Bus interface, and is +notably used by GNOME. +@end defvr + +@deftp {Data Type} upower-configuration +Data type representation the configuration for UPower. + +@table @asis + +@item @code{upower} (default: @var{upower}) +Package to use for @code{upower}. + +@item @code{watts-up-pro?} (default: @code{#f}) +Enable the Watts Up Pro device. + +@item @code{poll-batteries?} (default: @code{#t}) +Enable polling the kernel for battery level changes. + +@item @code{ignore-lid?} (default: @code{#f}) +Ignore the lid state, this can be useful if it's incorrect on a device. + +@item @code{use-percentage-for-policy?} (default: @code{#f}) +Whether battery percentage based policy should be used. The default is to use +the time left, change to @code{#t} to use the percentage. + +@item @code{percentage-low} (default: @code{10}) +When @code{use-percentage-for-policy?} is @code{#t}, this sets the percentage +at which the battery is considered low. + +@item @code{percentage-critical} (default: @code{3}) +When @code{use-percentage-for-policy?} is @code{#t}, this sets the percentage +at which the battery is considered critical. + +@item @code{percentage-action} (default: @code{2}) +When @code{use-percentage-for-policy?} is @code{#t}, this sets the percentage +at which action will be taken. + +@item @code{time-low} (default: @code{1200}) +When @code{use-time-for-policy?} is @code{#f}, this sets the time remaining in +seconds at which the battery is considered low. + +@item @code{time-critical} (default: @code{300}) +When @code{use-time-for-policy?} is @code{#f}, this sets the time remaining in +seconds at which the battery is considered critical. + +@item @code{time-action} (default: @code{120}) +When @code{use-time-for-policy?} is @code{#f}, this sets the time remaining in +seconds at which action will be taken. + +@item @code{critical-power-action} (default: @code{'hybrid-sleep}) +The action taken when @code{percentage-action} or @code{time-action} is +reached (depending on the configuration of @code{use-percentage-for-policy?}). + +Possible values are: + +@itemize @bullet +@item +@code{'power-off} + +@item +@code{'hibernate} + +@item +@code{'hybrid-sleep}. +@end itemize + +@end table +@end deftp @deffn {Scheme Procedure} udisks-service [#:udisks @var{udisks}] Return a service for @uref{http://udisks.freedesktop.org/docs/latest/, diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index df6764d278..a4d528f224 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -273,6 +273,11 @@ is set to @var{value} when the bus daemon launches it." (define upower-service-type (let ((upower-package (compose list upower-configuration-upower))) (service-type (name 'upower) + (description + "Run @command{upowerd}}, a system-wide monitor for power +consumption and battery levels, with the given configuration settings. It +implements the @code{org.freedesktop.UPower} D-Bus interface, and is notably +used by GNOME.") (extensions (list (service-extension dbus-root-service-type upower-dbus-service) @@ -285,7 +290,8 @@ is set to @var{value} when the bus daemon launches it." ;; Make the 'upower' command visible. (service-extension profile-service-type - upower-package)))))) + upower-package))) + (default-value (upower-configuration))))) (define* (upower-service #:key (upower upower) (watts-up-pro? #f) @@ -1029,7 +1035,7 @@ as expected."))) (service wpa-supplicant-service-type) ;needed by NetworkManager (service avahi-service-type) (udisks-service) - (upower-service) + (service upower-service-type) (accountsservice-service) (service cups-pk-helper-service-type) (colord-service) -- cgit v1.2.3 From 8d2c3c54ee4f7c2be1b9c897ee85c26cd5d34a50 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 29 Jan 2019 15:17:11 +0000 Subject: services: desktop: Deprecate the upower-service procedure. This has now been replaced by the upower-service-type and record. * gnu/services/desktop.scm (upower-service): Deprecate this procedure. --- gnu/services/desktop.scm | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index a4d528f224..ce63969dc8 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -51,6 +51,7 @@ #:use-module (gnu packages libusb) #:use-module (gnu packages mate) #:use-module (gnu packages enlightenment) + #:use-module (guix deprecation) #:use-module (guix records) #:use-module (guix packages) #:use-module (guix store) @@ -293,18 +294,18 @@ used by GNOME.") upower-package))) (default-value (upower-configuration))))) -(define* (upower-service #:key (upower upower) - (watts-up-pro? #f) - (poll-batteries? #t) - (ignore-lid? #f) - (use-percentage-for-policy? #f) - (percentage-low 10) - (percentage-critical 3) - (percentage-action 2) - (time-low 1200) - (time-critical 300) - (time-action 120) - (critical-power-action 'hybrid-sleep)) +(define-deprecated (upower-service #:key (upower upower) + (watts-up-pro? #f) + (poll-batteries? #t) + (ignore-lid? #f) + (use-percentage-for-policy? #f) + (percentage-low 10) + (percentage-critical 3) + (percentage-action 2) + (time-low 1200) + (time-critical 300) + (time-action 120) + (critical-power-action 'hybrid-sleep)) "Return a service that runs @uref{http://upower.freedesktop.org/, @command{upowerd}}, a system-wide monitor for power consumption and battery levels, with the given configuration settings. It implements the -- cgit v1.2.3 From e57c2adb2a7ed94610f4c35e8710bc1346199de6 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Wed, 13 Feb 2019 14:22:14 -0500 Subject: services: gdm: Remove etc service. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gnome.scm (gdm)[arguments]: Update pre-configure phase to make GDM get the configuration file path from an environment variable. * gnu/services/xorg.scm (gdm-etc-service): Remove function. (gdm-configuration-file): New function. (gdm-shepherd-service): Set GDM_CUSTOM_CONF before invoking GDM. (gdm-service-type)[extensions]: Remove etc-service-type extension. Signed-off-by: Ludovic Courtès --- gnu/packages/gnome.scm | 9 +++++-- gnu/services/xorg.scm | 67 ++++++++++++++++++++++++-------------------------- 2 files changed, 39 insertions(+), 37 deletions(-) (limited to 'gnu/services') diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 2f99755933..21c61473c5 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -32,7 +32,7 @@ ;;; Copyright © 2018 Jovany Leandro G.C ;;; Copyright © 2018 Vasile Dumitrascu ;;; Copyright © 2018 Björn Höfling -;;; Copyright © 2018 Timothy Sample +;;; Copyright © 2018, 2019 Timothy Sample ;;; ;;; This file is part of GNU Guix. ;;; @@ -5462,6 +5462,9 @@ libxml2.") ;; processes. "gdm_session_set_environment_variable (self, \"GDM_X_SERVER\",\n" " g_getenv (\"GDM_X_SERVER\"));\n" + ;; Propagate the GDM_CUSTOM_CONF environment variable. + "gdm_session_set_environment_variable (self, \"GDM_CUSTOM_CONF\",\n" + " g_getenv (\"GDM_CUSTOM_CONF\"));\n" ;; FIXME: Really glib should be declaring XDG_CONFIG_DIRS as a ;; variable, but it doesn't do that right now. Anyway ;; /run/current-system/profile/share/gnome-session/sessions/gnome.desktop @@ -5481,7 +5484,9 @@ libxml2.") ;; Look for custom GDM conf in /run/current-system. (substitute* '("common/gdm-settings-desktop-backend.c") (("GDM_CUSTOM_CONF") - "\"/run/current-system/etc/gdm/custom.conf\"")) + (string-append "(g_getenv(\"GDM_CUSTOM_CONF\") != NULL" + " ? g_getenv(\"GDM_CUSTOM_CONF\")" + " : GDM_CUSTOM_CONF)"))) ;; Use service-supplied path to X. (substitute* '("daemon/gdm-server.c") (("\\(X_SERVER X_SERVER_ARG_FORMAT") diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 1efb275794..de5438e3fe 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2017 Andy Wingo ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès ;;; Copyright © 2015 Sou Bunnbu -;;; Copyright © 2018 Timothy Sample +;;; Copyright © 2018, 2019 Timothy Sample ;;; ;;; This file is part of GNU Guix. ;;; @@ -633,38 +633,34 @@ makes the good ol' XlockMore usable." (x-server gdm-configuration-x-server (default (xorg-wrapper)))) -(define (gdm-etc-service config) - (define gdm-configuration-file - (mixed-text-file "gdm-custom.conf" - "[daemon]\n" - "#User=gdm\n" - "#Group=gdm\n" - (if (gdm-configuration-auto-login? config) - (string-append - "AutomaticLoginEnable=true\n" - "AutomaticLogin=" - (or (gdm-configuration-default-user config) - (error "missing default user for auto-login")) - "\n") - (string-append - "AutomaticLoginEnable=false\n" - "#AutomaticLogin=\n")) - "#TimedLoginEnable=false\n" - "#TimedLogin=\n" - "#TimedLoginDelay=0\n" - "#InitialSetupEnable=true\n" - ;; Enable me once X is working. - "WaylandEnable=false\n" - "\n" - "[debug]\n" - "#Enable=true\n" - "\n" - "[security]\n" - "#DisallowTCP=true\n" - "#AllowRemoteAutoLogin=false\n")) - `(("gdm" ,(file-union - "gdm" - `(("custom.conf" ,gdm-configuration-file)))))) +(define (gdm-configuration-file config) + (mixed-text-file "gdm-custom.conf" + "[daemon]\n" + "#User=gdm\n" + "#Group=gdm\n" + (if (gdm-configuration-auto-login? config) + (string-append + "AutomaticLoginEnable=true\n" + "AutomaticLogin=" + (or (gdm-configuration-default-user config) + (error "missing default user for auto-login")) + "\n") + (string-append + "AutomaticLoginEnable=false\n" + "#AutomaticLogin=\n")) + "#TimedLoginEnable=false\n" + "#TimedLogin=\n" + "#TimedLoginDelay=0\n" + "#InitialSetupEnable=true\n" + ;; Enable me once X is working. + "WaylandEnable=false\n" + "\n" + "[debug]\n" + "#Enable=true\n" + "\n" + "[security]\n" + "#DisallowTCP=true\n" + "#AllowRemoteAutoLogin=false\n")) (define (gdm-pam-service config) "Return a PAM service for @command{gdm}." @@ -698,6 +694,9 @@ makes the good ol' XlockMore usable." "/bin/gdm")) #:environment-variables (list (string-append + "GDM_CUSTOM_CONF=" + #$(gdm-configuration-file config)) + (string-append "GDM_X_SERVER=" #$(gdm-configuration-x-server config)) ;; XXX: GDM requires access to a handful of @@ -719,8 +718,6 @@ makes the good ol' XlockMore usable." (const %gdm-accounts)) (service-extension pam-root-service-type gdm-pam-service) - (service-extension etc-service-type - gdm-etc-service) (service-extension dbus-root-service-type (compose list gdm-configuration-gdm)))) -- cgit v1.2.3 From 1f564c1573f2d120a55e3b321a0c558a51720bce Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Wed, 13 Feb 2019 14:22:19 -0500 Subject: gnu: gdm: Run dbus-daemon via a wrapper script. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gnome.scm (gdm)[arguments]: Modify the pre-configure phase so that GDM propagates the GDM_DBUS_DAEMON variable into the session environment and uses its value to invoke dbus-daemon. * gnu/services/xorg.scm (dbus-daemon-wrapper): New variable. (): Add 'dbus-daemon' field. (gdm-shepherd-service): Set GDM_DBUS_DAEMON before invoking gdm. Signed-off-by: Ludovic Courtès --- gnu/packages/gnome.scm | 3 +++ gnu/services/xorg.scm | 15 +++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'gnu/services') diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index dec567a0e0..794f3a8843 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -5461,6 +5461,7 @@ libxml2.") (("DATADIR \"/gnome") "\"/run/current-system/profile/share/gnome")) (let ((propagate '("GDM_CUSTOM_CONF" + "GDM_DBUS_DAEMON" "GDM_X_SERVER" ;; XXX: Remove this once GNOME Shell is ;; a dependency of GDM. @@ -5486,6 +5487,8 @@ libxml2.") (("\\(X_SERVER X_SERVER_ARG_FORMAT") "(\"%s\" X_SERVER_ARG_FORMAT, g_getenv (\"GDM_X_SERVER\")")) (substitute* '("daemon/gdm-x-session.c") + (("\"dbus-daemon\"") + "g_getenv (\"GDM_DBUS_DAEMON\")") (("X_SERVER") "g_getenv (\"GDM_X_SERVER\")")) ;; Use an absolute path for GNOME Session. diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index de5438e3fe..6a589779b9 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -29,6 +29,7 @@ #:use-module (gnu packages guile) #:use-module (gnu packages xorg) #:use-module (gnu packages gl) + #:use-module (gnu packages glib) #:use-module (gnu packages display-managers) #:use-module (gnu packages gnustep) #:use-module (gnu packages gnome) @@ -623,12 +624,23 @@ makes the good ol' XlockMore usable." (home-directory "/var/lib/gdm") (shell (file-append shadow "/sbin/nologin"))))) +(define dbus-daemon-wrapper + (program-file "gdm-dbus-wrapper" + #~(begin + (setenv "XDG_CONFIG_DIRS" + "/run/current-system/profile/etc/xdg") + (setenv "XDG_DATA_DIRS" + "/run/current-system/profile/share") + (apply execl (string-append #$dbus "/bin/dbus-daemon") + (program-arguments))))) + (define-record-type* gdm-configuration make-gdm-configuration gdm-configuration? (gdm gdm-configuration-gdm (default gdm)) (allow-empty-passwords? gdm-configuration-allow-empty-passwords? (default #t)) (auto-login? gdm-configuration-auto-login? (default #f)) + (dbus-daemon gdm-configuration-dbus-daemon (default dbus-daemon-wrapper)) (default-user gdm-configuration-default-user (default #f)) (x-server gdm-configuration-x-server (default (xorg-wrapper)))) @@ -696,6 +708,9 @@ makes the good ol' XlockMore usable." (list (string-append "GDM_CUSTOM_CONF=" #$(gdm-configuration-file config)) + (string-append + "GDM_DBUS_DAEMON=" + #$(gdm-configuration-dbus-daemon config)) (string-append "GDM_X_SERVER=" #$(gdm-configuration-x-server config)) -- cgit v1.2.3 From 7e61419892aa68f7238e50e71f6e69a2e6a53211 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Wed, 13 Feb 2019 14:22:20 -0500 Subject: services: gdm: Make dependencies explicit. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit removes the remaining implicit dependencies that the GDM service had on the GNOME Desktop service. * gnu/services/xorg.scm (gdm-configuration): Add a gnome-shell-assets field for specifying any icons or fonts that the GNOME Shell theme needs. (gdm-shepherd-service): Remove environment variables pointing to '/run/current-system' and set XDG_DATA_DIRS so that it points to 'gnome-shell' and its assets. (gdm-service-type): Extend 'profile-service-type' to ensure that necessary fonts are installed in the system profile. Signed-off-by: Ludovic Courtès --- gnu/services/xorg.scm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 6a589779b9..4e6f5ad44f 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -28,6 +28,7 @@ #:use-module ((gnu packages base) #:select (canonical-package)) #:use-module (gnu packages guile) #:use-module (gnu packages xorg) + #:use-module (gnu packages fonts) #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages display-managers) @@ -642,6 +643,8 @@ makes the good ol' XlockMore usable." (auto-login? gdm-configuration-auto-login? (default #f)) (dbus-daemon gdm-configuration-dbus-daemon (default dbus-daemon-wrapper)) (default-user gdm-configuration-default-user (default #f)) + (gnome-shell-assets gdm-configuration-gnome-shell-assets + (default (list adwaita-icon-theme font-cantarell))) (x-server gdm-configuration-x-server (default (xorg-wrapper)))) @@ -714,13 +717,16 @@ makes the good ol' XlockMore usable." (string-append "GDM_X_SERVER=" #$(gdm-configuration-x-server config)) - ;; XXX: GDM requires access to a handful of - ;; programs and components from Gnome (gnome-shell, - ;; dbus, and gnome-session among others). The - ;; following variables only work provided Gnome is - ;; installed. - "XDG_DATA_DIRS=/run/current-system/profile/share" - "PATH=/run/current-system/profile/bin")))) + (string-append + "XDG_DATA_DIRS=" + ((lambda (ls) (string-join ls ":")) + (map (lambda (path) + (string-append path "/share")) + ;; XXX: Remove gnome-shell below when GDM + ;; can depend on GNOME Shell directly. + (cons #$gnome-shell + '#$(gdm-configuration-gnome-shell-assets + config))))))))) (stop #~(make-kill-destructor)) (respawn? #t)))) @@ -733,6 +739,8 @@ makes the good ol' XlockMore usable." (const %gdm-accounts)) (service-extension pam-root-service-type gdm-pam-service) + (service-extension profile-service-type + gdm-configuration-gnome-shell-assets) (service-extension dbus-root-service-type (compose list gdm-configuration-gdm)))) -- cgit v1.2.3 From 41fa9f1815685ede0d3fdc1c561d2a9cf0ffb158 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Wed, 13 Feb 2019 14:22:21 -0500 Subject: services: gdm: Allow for custom X session scripts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gnome.scm (gdm)[arguments]: Update pre-configure phase so that GDM runs an X session script specified by the variable GDM_X_SESSION; remove the '--enable-gdm-xsession' configuration option. * gnu/services/xorg.scm (): Add 'x-session' field. (gdm-shepherd-service): Set the GDM_X_SESSION variable. Signed-off-by: Ludovic Courtès --- gnu/packages/gnome.scm | 9 ++++----- gnu/services/xorg.scm | 7 ++++++- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'gnu/services') diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 794f3a8843..7001a12b19 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -5410,10 +5410,6 @@ libxml2.") ;; service for TTY 1 before starting GDM). "--with-initial-vt=7" - ;; By default, GDM expects distributions to install a custom Xsession - ;; script. It provides a generic one if --enable-gdm-xsession is set. - "--enable-gdm-xsession" - ;; Use '/etc/environment' for locale settings instead of the ;; systemd-specific '/etc/locale.conf'. "--with-lang-file=/etc/environment" @@ -5463,6 +5459,7 @@ libxml2.") (let ((propagate '("GDM_CUSTOM_CONF" "GDM_DBUS_DAEMON" "GDM_X_SERVER" + "GDM_X_SESSION" ;; XXX: Remove this once GNOME Shell is ;; a dependency of GDM. "XDG_DATA_DIRS"))) @@ -5490,7 +5487,9 @@ libxml2.") (("\"dbus-daemon\"") "g_getenv (\"GDM_DBUS_DAEMON\")") (("X_SERVER") - "g_getenv (\"GDM_X_SERVER\")")) + "g_getenv (\"GDM_X_SERVER\")") + (("GDMCONFDIR \"/Xsession\"") + "g_getenv (\"GDM_X_SESSION\")")) ;; Use an absolute path for GNOME Session. (substitute* "daemon/gdm-launch-environment.c" (("\"gnome-session\"") diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 4e6f5ad44f..f7d07b309e 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -646,7 +646,9 @@ makes the good ol' XlockMore usable." (gnome-shell-assets gdm-configuration-gnome-shell-assets (default (list adwaita-icon-theme font-cantarell))) (x-server gdm-configuration-x-server - (default (xorg-wrapper)))) + (default (xorg-wrapper))) + (x-session gdm-configuration-x-session + (default (xinitrc)))) (define (gdm-configuration-file config) (mixed-text-file "gdm-custom.conf" @@ -717,6 +719,9 @@ makes the good ol' XlockMore usable." (string-append "GDM_X_SERVER=" #$(gdm-configuration-x-server config)) + (string-append + "GDM_X_SESSION=" + #$(gdm-configuration-x-session config)) (string-append "XDG_DATA_DIRS=" ((lambda (ls) (string-join ls ":")) -- cgit v1.2.3 From 24f11b06bbd2c7f4a236a5ef4b6d9c7bf5be47a8 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 15 Feb 2019 19:13:55 +0100 Subject: services: xorg: Enable override of xserver-arguments. * gnu/services/xorg.scm (xorg-start-command): Add parameter #:xserver-arguments. * doc/guix.texi (X Window): Document it. --- doc/guix.texi | 19 ++++++++++++++++++- gnu/services/xorg.scm | 8 +++++--- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 04192840a0..2ccc788703 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -31,7 +31,7 @@ Copyright @copyright{} 2016, 2017, 2018 Chris Marusich@* Copyright @copyright{} 2016, 2017, 2018 Efraim Flashner@* Copyright @copyright{} 2016 John Darrington@* Copyright @copyright{} 2016, 2017 Nils Gillmann@* -Copyright @copyright{} 2016, 2017, 2018 Jan Nieuwenhuizen@* +Copyright @copyright{} 2016, 2017, 2018, 2019 Jan Nieuwenhuizen@* Copyright @copyright{} 2016 Julien Lepiller@* Copyright @copyright{} 2016 Alex ter Weele@* Copyright @copyright{} 2016, 2017, 2018, 2019 Christopher Baines@* @@ -13140,6 +13140,7 @@ type @code{}. [#:fonts %default-xorg-fonts] @ [#:configuration-file (xorg-configuration-file @dots{})] @ [#:xorg-server @var{xorg-server}] + [#:xserver-arguments '("-nolisten" "tcp")] Return a @code{startx} script in which @var{modules}, a list of X module packages, and @var{fonts}, a list of X font directories, are available. See @code{xorg-wrapper} for more details on the arguments. The result should be @@ -13148,6 +13149,22 @@ used in place of @code{startx}. Usually the X server is started by a login manager. @end deffn +@cindex @code{-listen tcp}, for X11. +This procedure is useful to override command line options for the X server, +such as having it listen to over TCP: + +@example +(operating-system + ... + (services + (modify-services %desktop-services + (slim-service-type config => + (slim-configuration + (inherit config) + (startx (xorg-start-command + #:xserver-arguments '("-listen" "tcp")))))))) +@end example + @deffn {Scheme Procedure} xorg-configuration-file @ [#:modules %default-xorg-modules] @ [#:fonts %default-xorg-fonts] @ diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index f7d07b309e..f2a3c28c90 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2018, 2019 Timothy Sample +;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -292,7 +293,8 @@ in place of @code{/usr/bin/X}." (configuration-file (xorg-configuration-file #:modules modules #:fonts fonts)) - (xorg-server xorg-server)) + (xorg-server xorg-server) + (xserver-arguments '("-nolisten" "tcp"))) "Return a @code{startx} script in which @var{modules}, a list of X module packages, and @var{fonts}, a list of X font directories, are available. See @code{xorg-wrapper} for more details on the arguments. The result should be @@ -305,8 +307,8 @@ used in place of @code{startx}." (define exp ;; Write a small wrapper around the X server. #~(apply execl #$X #$X ;; Second #$X is for argv[0]. - "-logverbose" "-verbose" "-nolisten" "tcp" "-terminate" - (cdr (command-line)))) + "-logverbose" "-verbose" "-terminate" #$@xserver-arguments + (cdr (command-line)))) (program-file "startx" exp)) -- cgit v1.2.3