[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
14/16: services: xorg: Add auto-suspend? field to <gdm-configuration>.
From: |
guix-commits |
Subject: |
14/16: services: xorg: Add auto-suspend? field to <gdm-configuration>. |
Date: |
Fri, 7 Oct 2022 10:13:41 -0400 (EDT) |
apteryx pushed a commit to branch master
in repository guix.
commit aad4e4fc6bed1209479970f1bcd2f08ee2b53d12
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Thu Sep 22 15:48:16 2022 -0400
services: xorg: Add auto-suspend? field to <gdm-configuration>.
* gnu/services/xorg.scm (<gdm-configuration>)
<auto-suspend?>: New field.
(gdm-dconf-profiles): New variable.
* gnu/services/xorg.scm (gdm-shepherd-service)
<environment-variables> [!auto-suspend?]: Specify DCONF_PROFILE.
(gdm-service-type): Extend DCONF-SERVICE-TYPE.
* doc/guix.texi (X Window): Document the new field.
---
doc/guix.texi | 6 ++++++
gnu/services/xorg.scm | 32 +++++++++++++++++++++++++++++++-
2 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 4e75a5c00e..27f63904cd 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -21107,6 +21107,12 @@ When @code{auto-login?} is false, GDM presents a
log-in screen.
When @code{auto-login?} is true, GDM logs in directly as
@code{default-user}.
+@item @code{auto-suspend?} (default @code{#t})
+When true, GDM will automatically suspend to RAM when nobody is
+physically connected. When a machine is used via remote desktop or SSH,
+this should be set to false to avoid GDM interrupting remote sessions or
+rendering the machine unavailable.
+
@item @code{debug?} (default: @code{#f})
When true, GDM writes debug messages to its log.
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 9205c6f9f4..902fef0058 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -986,6 +986,7 @@ argument.")))
(gdm gdm-configuration-gdm (default gdm))
(allow-empty-passwords? gdm-configuration-allow-empty-passwords? (default
#t))
(auto-login? gdm-configuration-auto-login? (default #f))
+ (auto-suspend? gdm-configuration-auto-suspend? (default #t))
(dbus-daemon gdm-configuration-dbus-daemon (default dbus-daemon-wrapper))
(debug? gdm-configuration-debug? (default #f))
(default-user gdm-configuration-default-user (default #f))
@@ -1001,6 +1002,30 @@ argument.")))
(wayland-session gdm-configuration-wayland-session
(default gdm-wayland-session-wrapper)))
+(define (gdm-dconf-profiles config)
+ (if (gdm-configuration-auto-suspend? config)
+ '()
+ ;; This custom gconf profile works around a lack of configuration option
+ ;; to disable auto-suspend when no users are physically logged in (see:
+ ;; https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/22).
+ (list (dconf-profile
+ (name "gdm")
+ (content (list #~(begin
+ (use-modules (ice-9 textual-ports))
+ (string-trim
+ (call-with-input-file
+ #$(file-append gdm
"/share/dconf/profile/gdm")
+ get-string-all)))
+ "system-db:gdm"))
+ (keyfile (dconf-keyfile
+ (name "00-disable-suspend")
+ (content
+ (list "[org/gnome/settings-daemon/plugins/power]"
+ "sleep-inactive-ac-type='nothing'"
+ "sleep-inactive-battery-type='nothing'"
+ "sleep-inactive-ac-timeout=0"
+ "sleep-inactive-battery-timeout=0"))))))))
+
(define (gdm-configuration-file config)
(mixed-text-file "gdm-custom.conf"
"[daemon]\n"
@@ -1073,7 +1098,10 @@ argument.")))
(list #$(file-append (gdm-configuration-gdm config)
"/bin/gdm"))
#:environment-variables
- (list (string-append
+ (list #$@(if (gdm-configuration-auto-suspend? config)
+ #~()
+ #~("DCONF_PROFILE=/etc/dconf/profile/gdm"))
+ (string-append
"GDM_CUSTOM_CONF="
#$(gdm-configuration-file config))
(string-append
@@ -1152,6 +1180,8 @@ polkit.addRule(function(action, subject) {
gdm-shepherd-service)
(service-extension account-service-type
(const %gdm-accounts))
+ (service-extension dconf-service-type
+ gdm-dconf-profiles)
(service-extension pam-root-service-type
gdm-pam-service)
(service-extension polkit-service-type
- branch master updated (31708431c5 -> 6e3dab4737), guix-commits, 2022/10/07
- 03/16: gnu: tigervnc-server: Adjust PAM config., guix-commits, 2022/10/07
- 04/16: gnu: tigervnc-server: Disable tests via #:tests?., guix-commits, 2022/10/07
- 05/16: gnu: tigervnc-server: Patch and wrap vncserver script., guix-commits, 2022/10/07
- 02/16: gnu: tigervnc-server: Move source production into origin snippet., guix-commits, 2022/10/07
- 08/16: marionette: Make marionette-screen-text private., guix-commits, 2022/10/07
- 06/16: gnu: gdm: Patch an extra reference to the Xsession script., guix-commits, 2022/10/07
- 15/16: services: Add xvnc-service-type., guix-commits, 2022/10/07
- 14/16: services: xorg: Add auto-suspend? field to <gdm-configuration>.,
guix-commits <=
- 09/16: marionette: Preserve screen dumps on failures., guix-commits, 2022/10/07
- 11/16: marionette: Add a callback arguments to wait-for-screen-text., guix-commits, 2022/10/07
- 01/16: gnu: tigervnc-server: Use new style inputs, gexps., guix-commits, 2022/10/07
- 07/16: services: gdm: Add a configuration field to enable XDMCP., guix-commits, 2022/10/07
- 10/16: marionette: Define keystrokes for typing colons and exclamation marks., guix-commits, 2022/10/07
- 12/16: gnu: dconf: Set sysconfdir to /etc., guix-commits, 2022/10/07
- 16/16: Update NEWS., guix-commits, 2022/10/07
- 13/16: services: Add dconf-service-type., guix-commits, 2022/10/07