1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
3 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
5 ;;; Copyright © 2018, 2019 Timothy Sample <samplet@ngyro.com>
6 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
7 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu services xorg)
25 #:use-module (gnu artwork)
26 #:use-module (gnu services)
27 #:use-module (gnu services shepherd)
28 #:use-module (gnu system pam)
29 #:use-module (gnu system keyboard)
30 #:use-module (gnu services base)
31 #:use-module (gnu services dbus)
32 #:use-module ((gnu packages base) #:select (canonical-package))
33 #:use-module (gnu packages guile)
34 #:use-module (gnu packages xorg)
35 #:use-module (gnu packages fonts)
36 #:use-module (gnu packages gl)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages display-managers)
39 #:use-module (gnu packages freedesktop)
40 #:use-module (gnu packages gnustep)
41 #:use-module (gnu packages gnome)
42 #:use-module (gnu packages admin)
43 #:use-module (gnu packages bash)
44 #:use-module (gnu system shadow)
45 #:use-module (guix gexp)
46 #:use-module (guix store)
47 #:use-module (guix packages)
48 #:use-module (guix derivations)
49 #:use-module (guix records)
50 #:use-module (guix deprecation)
51 #:use-module (srfi srfi-1)
52 #:use-module (srfi srfi-9)
53 #:use-module (srfi srfi-26)
54 #:use-module (ice-9 match)
55 #:export (xorg-configuration
57 xorg-configuration-modules
58 xorg-configuration-fonts
59 xorg-configuration-drivers
60 xorg-configuration-resolutions
61 xorg-configuration-extra-config
62 xorg-configuration-server
63 xorg-configuration-server-arguments
72 %default-slim-theme-name
76 slim-configuration-slim
77 slim-configuration-allow-empty-passwords?
78 slim-configuration-auto-login?
79 slim-configuration-default-user
80 slim-configuration-theme
81 slim-configuration-theme-name
82 slim-configuration-xauth
83 slim-configuration-shepherd
84 slim-configuration-auto-login-session
85 slim-configuration-xorg
86 slim-configuration-sessreg
93 screen-locker-service-type
97 localed-configuration?
106 ;;; Services that relate to the X Window System.
110 (define %default-xorg-modules
111 ;; Default list of modules loaded by the server. When multiple drivers
112 ;; match, the first one in the list is loaded.
113 (list xf86-video-vesa
124 ;; Libinput is the new thing and is recommended over evdev/synaptics:
125 ;; <http://who-t.blogspot.fr/2015/01/xf86-input-libinput-compatibility-with.html>.
131 xf86-input-synaptics))
133 (define %default-xorg-fonts
134 ;; Default list of fonts available to the X server.
135 (list (file-append font-alias "/share/fonts/X11/75dpi")
136 (file-append font-alias "/share/fonts/X11/100dpi")
137 (file-append font-alias "/share/fonts/X11/misc")
138 (file-append font-alias "/share/fonts/X11/cyrillic")
139 (file-append font-misc-misc ;default fonts for xterm
140 "/share/fonts/X11/misc")
141 (file-append font-adobe75dpi "/share/fonts/X11/75dpi")))
143 (define %default-xorg-server-arguments
144 ;; Default command-line arguments for X.
145 '("-nolisten" "tcp"))
147 ;; Configuration of an Xorg server.
148 (define-record-type* <xorg-configuration>
149 xorg-configuration make-xorg-configuration
151 (modules xorg-configuration-modules ;list of packages
152 (default %default-xorg-modules))
153 (fonts xorg-configuration-fonts ;list of packges
154 (default %default-xorg-fonts))
155 (drivers xorg-configuration-drivers ;list of strings
157 (resolutions xorg-configuration-resolutions ;list of tuples
159 (keyboard-layout xorg-configuration-keyboard-layout ;#f | <keyboard-layout>
161 (extra-config xorg-configuration-extra-config ;list of strings
163 (server xorg-configuration-server ;package
164 (default xorg-server))
165 (server-arguments xorg-configuration-server-arguments ;list of strings
166 (default %default-xorg-server-arguments)))
168 (define (xorg-configuration->file config)
169 "Compute an Xorg configuration file corresponding to CONFIG, an
170 <xorg-configuration> record."
172 ;; 'xorg-server' provides 'fbdevhw.so' etc.
173 (append (xorg-configuration-modules config)
178 (use-modules (ice-9 match)
182 (call-with-output-file #$output
185 '#$(xorg-configuration-drivers config))
187 (define (device-section driver)
190 Identifier \"device-" driver "\"
191 Driver \"" driver "\"
194 (define (screen-section driver resolutions)
197 Identifier \"screen-" driver "\"
198 Device \"device-" driver "\"
199 SubSection \"Display\"
201 (string-join (map (match-lambda
203 (string-append "\"" (number->string x)
204 "x" (number->string y) "\"")))
209 (define (input-class-section layout variant model options)
211 Section \"InputClass\"
212 Identifier \"evdev keyboard catchall\"
213 MatchIsKeyboard \"on\"
214 Option \"XkbLayout\" " (object->string layout)
216 (string-append " Option \"XkbVariant\" \""
220 (string-append " Option \"XkbModel\" \""
227 (string-append " Option \"XkbOptions\" \""
228 (string-join options ",") "\""))) "
230 MatchDevicePath \"/dev/input/event*\"
234 (define (expand modules)
235 ;; Append to MODULES the relevant /lib/xorg/modules
237 (append-map (lambda (module)
238 (filter-map (lambda (directory)
239 (let ((full (string-append module
241 (and (file-exists? full)
243 '("/lib/xorg/modules/drivers"
244 "/lib/xorg/modules/input"
245 "/lib/xorg/modules/multimedia"
246 "/lib/xorg/modules/extensions")))
249 (display "Section \"Files\"\n" port)
250 (for-each (lambda (font)
251 (format port " FontPath \"~a\"~%" font))
252 '#$(xorg-configuration-fonts config))
253 (for-each (lambda (module)
255 " ModulePath \"~a\"~%"
257 (append (expand '#$all-modules)
259 ;; For fbdevhw.so and so on.
260 (list #$(file-append xorg-server
261 "/lib/xorg/modules"))))
262 (display "EndSection\n" port)
264 Section \"ServerFlags\"
265 Option \"AllowMouseOpenFail\" \"on\"
268 (display (string-join (map device-section drivers) "\n")
271 (display (string-join
272 (map (cut screen-section <>
273 '#$(xorg-configuration-resolutions config))
279 (let ((layout #$(and=> (xorg-configuration-keyboard-layout config)
280 keyboard-layout-name))
281 (variant #$(and=> (xorg-configuration-keyboard-layout config)
282 keyboard-layout-variant))
283 (model #$(and=> (xorg-configuration-keyboard-layout config)
284 keyboard-layout-model))
285 (options '#$(and=> (xorg-configuration-keyboard-layout config)
286 keyboard-layout-options)))
288 (display (input-class-section layout variant model options)
292 (for-each (lambda (config)
293 (display config port))
294 '#$(xorg-configuration-extra-config config))))))
296 (computed-file "xserver.conf" build))
298 (define (xorg-configuration-directory modules)
299 "Return a directory that contains the @code{.conf} files for X.org that
300 includes the @code{share/X11/xorg.conf.d} directories of each package listed
302 (with-imported-modules '((guix build utils))
303 (computed-file "xorg.conf.d"
305 (use-modules (guix build utils)
309 (append-map (lambda (module)
310 (find-files (string-append
312 "/share/X11/xorg.conf.d")
317 (for-each (lambda (file)
319 (string-append #$output "/"
324 (define* (xorg-wrapper #:optional (config (xorg-configuration)))
325 "Return a derivation that builds a script to start the X server with the
326 given @var{config}. The resulting script should be used in place of
329 ;; Write a small wrapper around the X server.
331 (setenv "XORG_DRI_DRIVER_PATH" (string-append #$mesa "/lib/dri"))
332 (setenv "XKB_BINDIR" (string-append #$xkbcomp "/bin"))
334 (let ((X (string-append #$(xorg-configuration-server config) "/bin/X")))
336 "-xkbdir" (string-append #$xkeyboard-config "/share/X11/xkb")
337 "-config" #$(xorg-configuration->file config)
338 "-configdir" #$(xorg-configuration-directory
339 (xorg-configuration-modules config))
340 (cdr (command-line))))))
342 (program-file "X-wrapper" exp))
344 (define* (xorg-start-command #:optional (config (xorg-configuration)))
345 "Return a @code{startx} script in which the modules, fonts, etc. specified
346 in @var{config}, are available. The result should be used in place of
349 (xorg-wrapper config))
352 ;; Write a small wrapper around the X server.
353 #~(apply execl #$X #$X ;; Second #$X is for argv[0].
354 "-logverbose" "-verbose" "-terminate"
355 #$@(xorg-configuration-server-arguments config)
356 (cdr (command-line))))
358 (program-file "startx" exp))
360 (define* (xinitrc #:key fallback-session)
361 "Return a system-wide xinitrc script that starts the specified X session,
362 which should be passed to this script as the first argument. If not, the
363 @var{fallback-session} will be used or, if @var{fallback-session} is false, a
364 desktop session from the system or user profile will be used."
367 (use-modules (ice-9 match)
374 (define (close-all-fdes)
375 ;; Close all the open file descriptors except 0 to 2.
377 (when (< fd 4096) ;FIXME: use sysconf + _SC_OPEN_MAX
378 (false-if-exception (close-fdes fd))
381 (define (exec-from-login-shell command . args)
382 ;; Run COMMAND from a login shell so that it gets to see the same
383 ;; environment variables that one gets when logging in on a tty, for
385 (let* ((pw (getpw (getuid)))
386 (shell (passwd:shell pw)))
387 ;; Close any open file descriptors. This is all the more
388 ;; important that SLiM itself exec's us directly without closing
389 ;; its own file descriptors!
392 ;; The '--login' option is supported at least by Bash and zsh.
393 (execl shell shell "--login" "-c"
394 (string-join (cons command args)))))
396 (define system-profile
397 "/run/current-system/profile")
400 (and=> (getpw (getuid))
402 (string-append (passwd:dir pw) "/.guix-profile"))))
404 (define (xsession-command desktop-file)
405 ;; Read from DESKTOP-FILE its X session command and return it as a
408 (make-regexp "^[[:blank:]]*Exec=(.*)$"))
410 (call-with-input-file desktop-file
413 (match (read-line port)
415 ((= (cut regexp-exec exec-regexp <>) result)
417 (string-tokenize (match:substring result 1))
420 (define (find-session profile)
421 ;; Return an X session command from PROFILE or #f if none was found.
422 (let ((directory (string-append profile "/share/xsessions")))
423 (match (scandir directory
424 (cut string-suffix? ".desktop" <>))
428 (any xsession-command
429 (map (cut string-append directory "/" <>)
432 (let* ((home (getenv "HOME"))
433 (xsession-file (string-append home "/.xsession"))
434 (session (match (command-line)
436 #$(if fallback-session
437 #~(list #$fallback-session)
441 (if (file-exists? xsession-file)
442 ;; Run ~/.xsession when it exists.
443 (apply exec-from-login-shell xsession-file
445 ;; Otherwise, start the specified session or a fallback.
446 (apply exec-from-login-shell
448 (find-session user-profile)
449 (find-session system-profile)))))))
451 (program-file "xinitrc" builder))
455 ;;; SLiM log-in manager.
458 (define %default-slim-theme
459 ;; Theme based on work by Felipe López.
460 (file-append %artwork-repository "/slim"))
462 (define %default-slim-theme-name
463 ;; This must be the name of the sub-directory in %DEFAULT-SLIM-THEME that
464 ;; contains the actual theme files.
467 (define-record-type* <slim-configuration>
468 slim-configuration make-slim-configuration
470 (slim slim-configuration-slim
472 (allow-empty-passwords? slim-configuration-allow-empty-passwords?
474 (auto-login? slim-configuration-auto-login?
476 (default-user slim-configuration-default-user
478 (theme slim-configuration-theme
479 (default %default-slim-theme))
480 (theme-name slim-configuration-theme-name
481 (default %default-slim-theme-name))
482 (xauth slim-configuration-xauth
484 (shepherd slim-configuration-shepherd
486 (auto-login-session slim-configuration-auto-login-session
488 (xorg-configuration slim-configuration-xorg
489 (default (xorg-configuration)))
490 (sessreg slim-configuration-sessreg
493 (define (slim-pam-service config)
494 "Return a PAM service for @command{slim}."
495 (list (unix-pam-service
497 #:allow-empty-passwords?
498 (slim-configuration-allow-empty-passwords? config))))
500 (define (slim-shepherd-service config)
502 (let ((xinitrc (xinitrc #:fallback-session
503 (slim-configuration-auto-login-session config)))
504 (slim (slim-configuration-slim config))
505 (xauth (slim-configuration-xauth config))
506 (startx (xorg-start-command (slim-configuration-xorg config)))
507 (shepherd (slim-configuration-shepherd config))
508 (theme-name (slim-configuration-theme-name config))
509 (sessreg (slim-configuration-sessreg config)))
510 (mixed-text-file "slim.cfg" "
511 default_path /run/current-system/profile/bin
512 default_xserver " startx "
513 xserver_arguments :0 vt7
514 xauth_path " xauth "/bin/xauth
515 authfile /var/run/slim.auth
517 # The login command. '%session' is replaced by the chosen session name, one
518 # of the names specified in the 'sessions' setting: 'wmaker', 'xfce', etc.
519 login_cmd exec " xinitrc " %session
520 sessiondir /run/current-system/profile/share/xsessions
521 session_msg session (F1 to change):
522 sessionstart_cmd " sessreg "/bin/sessreg -a -l $DISPLAY %user
523 sessionstop_cmd " sessreg "/bin/sessreg -d -l $DISPLAY %user
525 halt_cmd " shepherd "/sbin/halt
526 reboot_cmd " shepherd "/sbin/reboot\n"
527 (if (slim-configuration-auto-login? config)
528 (string-append "auto_login yes\ndefault_user "
529 (slim-configuration-default-user config) "\n")
532 (string-append "current_theme " theme-name "\n")
536 (slim-configuration-theme config))
538 (list (shepherd-service
539 (documentation "Xorg display server")
540 (provision '(xorg-server))
541 (requirement '(user-processes host-name udev))
544 ;; A stale lock file can prevent SLiM from starting, so remove it to
545 ;; be on the safe side.
546 (false-if-exception (delete-file "/var/run/slim.lock"))
549 (list (string-append #$slim "/bin/slim") "-nodaemon")
550 #:environment-variables
551 (list (string-append "SLIM_CFGFILE=" #$slim.cfg)
553 (list #~(string-append "SLIM_THEMESDIR=" #$theme))
555 (stop #~(make-kill-destructor))
558 (define slim-service-type
559 (service-type (name 'slim)
561 (list (service-extension shepherd-root-service-type
562 slim-shepherd-service)
563 (service-extension pam-root-service-type
566 ;; Unconditionally add xterm to the system profile, to
567 ;; avoid bad surprises.
568 (service-extension profile-service-type
569 (const (list xterm)))))
570 (default-value (slim-configuration))))
572 (define-deprecated (slim-service #:key (slim slim)
573 (allow-empty-passwords? #t) auto-login?
575 (theme %default-slim-theme)
576 (theme-name %default-slim-theme-name)
577 (xauth xauth) (shepherd shepherd)
578 (auto-login-session #f)
579 (startx (xorg-start-command)))
581 "Return a service that spawns the SLiM graphical login manager, which in
582 turn starts the X display server with @var{startx}, a command as returned by
583 @code{xorg-start-command}.
587 SLiM automatically looks for session types described by the @file{.desktop}
588 files in @file{/run/current-system/profile/share/xsessions} and allows users
589 to choose a session from the log-in screen using @kbd{F1}. Packages such as
590 @var{xfce}, @var{sawfish}, and @var{ratpoison} provide @file{.desktop} files;
591 adding them to the system-wide set of packages automatically makes them
592 available at the log-in screen.
594 In addition, @file{~/.xsession} files are honored. When available,
595 @file{~/.xsession} must be an executable that starts a window manager
596 and/or other X clients.
598 When @var{allow-empty-passwords?} is true, allow logins with an empty
599 password. When @var{auto-login?} is true, log in automatically as
600 @var{default-user} with @var{auto-login-session}.
602 If @var{theme} is @code{#f}, the use the default log-in theme; otherwise
603 @var{theme} must be a gexp denoting the name of a directory containing the
604 theme to use. In that case, @var{theme-name} specifies the name of the
606 (service slim-service-type
609 (allow-empty-passwords? allow-empty-passwords?)
610 (auto-login? auto-login?) (default-user default-user)
611 (theme theme) (theme-name theme-name)
612 (xauth xauth) (shepherd shepherd)
613 (auto-login-session auto-login-session))))
617 ;;; Screen lockers & co.
620 (define-record-type <screen-locker>
621 (screen-locker name program empty?)
623 (name screen-locker-name) ;string
624 (program screen-locker-program) ;gexp
625 (empty? screen-locker-allows-empty-passwords?)) ;Boolean
627 (define screen-locker-pam-services
629 (($ <screen-locker> name _ empty?)
630 (list (unix-pam-service name
631 #:allow-empty-passwords? empty?)))))
633 (define screen-locker-setuid-programs
634 (compose list screen-locker-program))
636 (define screen-locker-service-type
637 (service-type (name 'screen-locker)
639 (list (service-extension pam-root-service-type
640 screen-locker-pam-services)
641 (service-extension setuid-program-service-type
642 screen-locker-setuid-programs)))))
644 (define* (screen-locker-service package
646 (program (package-name package))
647 #:key allow-empty-passwords?)
648 "Add @var{package}, a package for a screen locker or screen saver whose
649 command is @var{program}, to the set of setuid programs and add a PAM entry
653 (screen-locker-service xlockmore \"xlock\")
656 makes the good ol' XlockMore usable."
657 (service screen-locker-service-type
658 (screen-locker program
659 (file-append package "/bin/" program)
660 allow-empty-passwords?)))
667 (define-record-type* <localed-configuration>
668 localed-configuration make-localed-configuration
669 localed-configuration?
670 (localed localed-configuration-localed
672 (keyboard-layout localed-configuration-keyboard-layout
675 (define (localed-dbus-service config)
676 "Return the 'localed' D-Bus service for @var{config}, a
677 @code{<localed-configuration>} record."
678 (define keyboard-layout
679 (localed-configuration-keyboard-layout config))
681 ;; The primary purpose of 'localed' is to tell GDM what the "current" Xorg
682 ;; keyboard layout is. If 'localed' is missing, or if it's unable to
683 ;; determine the current XKB layout, then GDM forcefully installs its
684 ;; default XKB config (US English). Here we communicate the configured
685 ;; layout through environment variables.
688 (let* ((layout (keyboard-layout-name keyboard-layout))
689 (variant (keyboard-layout-variant keyboard-layout))
690 (model (keyboard-layout-model keyboard-layout))
691 (options (keyboard-layout-options keyboard-layout)))
692 (list (wrapped-dbus-service
693 (localed-configuration-localed config)
694 "libexec/localed/localed"
695 `(("GUIX_XKB_LAYOUT" ,layout)
697 `(("GUIX_XKB_VARIANT" ,variant))
700 `(("GUIX_XKB_MODEL" ,model))
702 ,@(if (null? options)
704 `(("GUIX_XKB_OPTIONS"
705 ,(string-join options ","))))))))
706 (localed-configuration-localed config)))
708 (define localed-service-type
709 (let ((package (compose list localed-configuration-localed)))
710 (service-type (name 'localed)
712 (list (service-extension dbus-root-service-type
713 localed-dbus-service)
714 (service-extension udev-service-type package)
715 (service-extension polkit-service-type package)
717 ;; Add 'localectl' to the profile.
718 (service-extension profile-service-type package)))
720 ;; This service can be extended, typically by the X login
721 ;; manager, to communicate the chosen Xorg keyboard layout.
723 (extend (lambda (config keyboard-layout)
724 (localed-configuration
726 (keyboard-layout keyboard-layout))))
728 "Run the locale daemon, @command{localed}, which can be used
729 to control the system locale and keyboard mapping from user programs such as
730 the GNOME desktop environment.")
731 (default-value (localed-configuration)))))
735 ;;; GNOME Desktop Manager.
738 (define %gdm-accounts
739 (list (user-group (name "gdm") (system? #t))
744 (comment "GNOME Display Manager user")
745 (home-directory "/var/lib/gdm")
746 (shell (file-append shadow "/sbin/nologin")))))
748 (define dbus-daemon-wrapper
749 (program-file "gdm-dbus-wrapper"
751 (setenv "XDG_CONFIG_DIRS"
752 "/run/current-system/profile/etc/xdg")
753 (setenv "XDG_DATA_DIRS"
754 "/run/current-system/profile/share")
755 (apply execl (string-append #$dbus "/bin/dbus-daemon")
756 (program-arguments)))))
758 (define-record-type* <gdm-configuration>
759 gdm-configuration make-gdm-configuration
761 (gdm gdm-configuration-gdm (default gdm))
762 (allow-empty-passwords? gdm-configuration-allow-empty-passwords? (default #t))
763 (auto-login? gdm-configuration-auto-login? (default #f))
764 (dbus-daemon gdm-configuration-dbus-daemon (default dbus-daemon-wrapper))
765 (default-user gdm-configuration-default-user (default #f))
766 (gnome-shell-assets gdm-configuration-gnome-shell-assets
767 (default (list adwaita-icon-theme font-cantarell)))
768 (xorg-configuration gdm-configuration-xorg
769 (default (xorg-configuration)))
770 (x-session gdm-configuration-x-session
771 (default (xinitrc))))
773 (define (gdm-configuration-file config)
774 (mixed-text-file "gdm-custom.conf"
778 (if (gdm-configuration-auto-login? config)
780 "AutomaticLoginEnable=true\n"
782 (or (gdm-configuration-default-user config)
783 (error "missing default user for auto-login"))
786 "AutomaticLoginEnable=false\n"
787 "#AutomaticLogin=\n"))
788 "#TimedLoginEnable=false\n"
790 "#TimedLoginDelay=0\n"
791 "#InitialSetupEnable=true\n"
792 ;; Enable me once X is working.
793 "WaylandEnable=false\n"
799 "#DisallowTCP=true\n"
800 "#AllowRemoteAutoLogin=false\n"))
802 (define (gdm-pam-service config)
803 "Return a PAM service for @command{gdm}."
806 (inherit (unix-pam-service "gdm-autologin"))
807 (auth (list (pam-entry
808 (control "[success=ok default=1]")
809 (module (file-append (gdm-configuration-gdm config)
810 "/lib/security/pam_gdm.so")))
812 (control "sufficient")
813 (module "pam_permit.so")))))
815 (inherit (unix-pam-service "gdm-launch-environment"))
816 (auth (list (pam-entry
818 (module "pam_permit.so")))))
819 (unix-pam-service "gdm-password"
820 #:allow-empty-passwords?
821 (gdm-configuration-allow-empty-passwords? config))))
823 (define (gdm-shepherd-service config)
824 (list (shepherd-service
825 (documentation "Xorg display server (GDM)")
826 (provision '(xorg-server))
827 (requirement '(dbus-system user-processes host-name udev))
830 (list #$(file-append (gdm-configuration-gdm config)
832 #:environment-variables
835 #$(gdm-configuration-file config))
838 #$(gdm-configuration-dbus-daemon config))
842 (gdm-configuration-xorg config)))
845 #$(gdm-configuration-x-session config))
848 ((lambda (ls) (string-join ls ":"))
850 (string-append path "/share"))
851 ;; XXX: Remove gnome-shell below when GDM
852 ;; can depend on GNOME Shell directly.
854 '#$(gdm-configuration-gnome-shell-assets
856 (stop #~(make-kill-destructor))
859 (define gdm-service-type
860 (service-type (name 'gdm)
862 (list (service-extension shepherd-root-service-type
863 gdm-shepherd-service)
864 (service-extension account-service-type
865 (const %gdm-accounts))
866 (service-extension pam-root-service-type
868 (service-extension profile-service-type
869 gdm-configuration-gnome-shell-assets)
870 (service-extension dbus-root-service-type
872 gdm-configuration-gdm))
873 (service-extension localed-service-type
875 xorg-configuration-keyboard-layout
876 gdm-configuration-xorg))))
878 (default-value (gdm-configuration))
880 "Run the GNOME Desktop Manager (GDM), a program that allows
881 you to log in in a graphical session, whether or not you use GNOME.")))
883 (define-deprecated (gdm-service #:key (gdm gdm)
884 (allow-empty-passwords? #t)
885 (x-server (xorg-wrapper)))
887 "Return a service that spawns the GDM graphical login manager, which in turn
888 starts the X display server with @var{X}, a command as returned by
893 GDM automatically looks for session types described by the @file{.desktop}
894 files in @file{/run/current-system/profile/share/xsessions} and allows users
895 to choose a session from the log-in screen using @kbd{F1}. Packages such as
896 @var{xfce}, @var{sawfish}, and @var{ratpoison} provide @file{.desktop} files;
897 adding them to the system-wide set of packages automatically makes them
898 available at the log-in screen.
900 In addition, @file{~/.xsession} files are honored. When available,
901 @file{~/.xsession} must be an executable that starts a window manager
902 and/or other X clients.
904 When @var{allow-empty-passwords?} is true, allow logins with an empty
906 (service gdm-service-type
909 (allow-empty-passwords? allow-empty-passwords?))))
911 ;;; xorg.scm ends here