mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
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.
This commit is contained in:
parent
7b896a26b8
commit
aad4e4fc6b
2 changed files with 37 additions and 1 deletions
|
@ -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
|
When @code{auto-login?} is true, GDM logs in directly as
|
||||||
@code{default-user}.
|
@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})
|
@item @code{debug?} (default: @code{#f})
|
||||||
When true, GDM writes debug messages to its log.
|
When true, GDM writes debug messages to its log.
|
||||||
|
|
||||||
|
|
|
@ -986,6 +986,7 @@ (define-record-type* <gdm-configuration>
|
||||||
(gdm gdm-configuration-gdm (default gdm))
|
(gdm gdm-configuration-gdm (default gdm))
|
||||||
(allow-empty-passwords? gdm-configuration-allow-empty-passwords? (default #t))
|
(allow-empty-passwords? gdm-configuration-allow-empty-passwords? (default #t))
|
||||||
(auto-login? gdm-configuration-auto-login? (default #f))
|
(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))
|
(dbus-daemon gdm-configuration-dbus-daemon (default dbus-daemon-wrapper))
|
||||||
(debug? gdm-configuration-debug? (default #f))
|
(debug? gdm-configuration-debug? (default #f))
|
||||||
(default-user gdm-configuration-default-user (default #f))
|
(default-user gdm-configuration-default-user (default #f))
|
||||||
|
@ -1001,6 +1002,30 @@ (define-record-type* <gdm-configuration>
|
||||||
(wayland-session gdm-configuration-wayland-session
|
(wayland-session gdm-configuration-wayland-session
|
||||||
(default gdm-wayland-session-wrapper)))
|
(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)
|
(define (gdm-configuration-file config)
|
||||||
(mixed-text-file "gdm-custom.conf"
|
(mixed-text-file "gdm-custom.conf"
|
||||||
"[daemon]\n"
|
"[daemon]\n"
|
||||||
|
@ -1073,7 +1098,10 @@ (define (gdm-shepherd-service config)
|
||||||
(list #$(file-append (gdm-configuration-gdm config)
|
(list #$(file-append (gdm-configuration-gdm config)
|
||||||
"/bin/gdm"))
|
"/bin/gdm"))
|
||||||
#:environment-variables
|
#:environment-variables
|
||||||
(list (string-append
|
(list #$@(if (gdm-configuration-auto-suspend? config)
|
||||||
|
#~()
|
||||||
|
#~("DCONF_PROFILE=/etc/dconf/profile/gdm"))
|
||||||
|
(string-append
|
||||||
"GDM_CUSTOM_CONF="
|
"GDM_CUSTOM_CONF="
|
||||||
#$(gdm-configuration-file config))
|
#$(gdm-configuration-file config))
|
||||||
(string-append
|
(string-append
|
||||||
|
@ -1152,6 +1180,8 @@ (define gdm-service-type
|
||||||
gdm-shepherd-service)
|
gdm-shepherd-service)
|
||||||
(service-extension account-service-type
|
(service-extension account-service-type
|
||||||
(const %gdm-accounts))
|
(const %gdm-accounts))
|
||||||
|
(service-extension dconf-service-type
|
||||||
|
gdm-dconf-profiles)
|
||||||
(service-extension pam-root-service-type
|
(service-extension pam-root-service-type
|
||||||
gdm-pam-service)
|
gdm-pam-service)
|
||||||
(service-extension polkit-service-type
|
(service-extension polkit-service-type
|
||||||
|
|
Loading…
Reference in a new issue