me
/
guix
Archived
1
0
Fork 0

services: set-xorg-configuration: handle slim and sddm

* gnu/services/xorg.scm (handle-xorg-configuration): New syntax.
  (gdm-service-type, slim-service-type): Use handle-xorg-configuration.
* gnu/services/sddm.scm (sddm-service-type): Likewise.
master
Jakub Kądziołka 2020-02-16 12:58:33 +01:00
parent 9b9ab657cc
commit 50be0da7bf
No known key found for this signature in database
GPG Key ID: E315A75846131564
2 changed files with 77 additions and 65 deletions

View File

@ -2,6 +2,7 @@
;;; Copyright © 2016 David Craven <david@craven.ch> ;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019 Jesse Gildersleve <jessejohngildersleve@protonmail.com> ;;; Copyright © 2019 Jesse Gildersleve <jessejohngildersleve@protonmail.com>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -306,22 +307,23 @@ Relogin=" (if (sddm-configuration-relogin? config)
(compose list sddm-configuration-sddm)) (compose list sddm-configuration-sddm))
(define sddm-service-type (define sddm-service-type
(service-type (name 'sddm) (handle-xorg-configuration sddm-configuration
(extensions (service-type (name 'sddm)
(list (service-extension shepherd-root-service-type (extensions
sddm-shepherd-service) (list (service-extension shepherd-root-service-type
(service-extension etc-service-type sddm-shepherd-service)
sddm-etc-service) (service-extension etc-service-type
(service-extension pam-root-service-type sddm-etc-service)
sddm-pam-services) (service-extension pam-root-service-type
(service-extension account-service-type sddm-pam-services)
(const %sddm-accounts)) (service-extension account-service-type
(service-extension profile-service-type (const %sddm-accounts))
sddm-profile-service))) (service-extension profile-service-type
(default-value (sddm-configuration)) sddm-profile-service)))
(description (default-value (sddm-configuration))
"Run SDDM, a display and log-in manager for X11 and (description
Wayland."))) "Run SDDM, a display and log-in manager for X11 and
Wayland."))))
(define-deprecated (sddm-service #:optional (config (sddm-configuration))) (define-deprecated (sddm-service #:optional (config (sddm-configuration)))
sddm-service-type sddm-service-type

View File

@ -6,6 +6,7 @@
;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de> ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
;;; Copyright © 2020 shtwzrd <shtwzrd@protonmail.com> ;;; Copyright © 2020 shtwzrd <shtwzrd@protonmail.com>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -103,6 +104,8 @@
gdm-configuration gdm-configuration
gdm-service-type gdm-service-type
gdm-service gdm-service
handle-xorg-configuration
set-xorg-configuration)) set-xorg-configuration))
;;; Commentary: ;;; Commentary:
@ -459,6 +462,25 @@ desktop session from the system or user profile will be used."
(program-file "xinitrc" builder)) (program-file "xinitrc" builder))
(define-syntax handle-xorg-configuration
(syntax-rules ()
"Generate the `compose' and `extend' entries of a login manager
`service-type' to handle specifying the `xorg-configuration' through
a `service-extension', as used by `set-xorg-configuration'."
((_ configuration-record service-type-definition)
(service-type
(inherit service-type-definition)
(compose (lambda (extensions)
(match extensions
(() #f)
((config . _) config))))
(extend (lambda (config xorg-configuration)
(if xorg-configuration
(configuration-record
(inherit config)
(xorg-configuration xorg-configuration))
config)))))))
;;; ;;;
;;; SLiM log-in manager. ;;; SLiM log-in manager.
@ -584,18 +606,20 @@ reboot_cmd " shepherd "/sbin/reboot\n"
(respawn? #t))))) (respawn? #t)))))
(define slim-service-type (define slim-service-type
(service-type (name 'slim) (handle-xorg-configuration slim-configuration
(extensions (service-type (name 'slim)
(list (service-extension shepherd-root-service-type (extensions
slim-shepherd-service) (list (service-extension shepherd-root-service-type
(service-extension pam-root-service-type slim-shepherd-service)
slim-pam-service) (service-extension pam-root-service-type
slim-pam-service)
;; Unconditionally add xterm to the system profile, to ;; Unconditionally add xterm to the system profile, to
;; avoid bad surprises. ;; avoid bad surprises.
(service-extension profile-service-type (service-extension profile-service-type
(const (list xterm))))) (const (list xterm)))))
(default-value (slim-configuration))))
(default-value (slim-configuration)))))
(define-deprecated (slim-service #:key (slim slim) (define-deprecated (slim-service #:key (slim slim)
(allow-empty-passwords? #t) auto-login? (allow-empty-passwords? #t) auto-login?
@ -946,44 +970,30 @@ the GNOME desktop environment.")
(respawn? #t)))) (respawn? #t))))
(define gdm-service-type (define gdm-service-type
(service-type (name 'gdm) (handle-xorg-configuration gdm-configuration
(extensions (service-type (name 'gdm)
(list (service-extension shepherd-root-service-type (extensions
gdm-shepherd-service) (list (service-extension shepherd-root-service-type
(service-extension activation-service-type gdm-shepherd-service)
(const %gdm-activation)) (service-extension activation-service-type
(service-extension account-service-type (const %gdm-activation))
(const %gdm-accounts)) (service-extension account-service-type
(service-extension pam-root-service-type (const %gdm-accounts))
gdm-pam-service) (service-extension pam-root-service-type
(service-extension profile-service-type gdm-pam-service)
gdm-configuration-gnome-shell-assets) (service-extension profile-service-type
(service-extension dbus-root-service-type gdm-configuration-gnome-shell-assets)
(compose list (service-extension dbus-root-service-type
gdm-configuration-gdm)) (compose list
(service-extension localed-service-type gdm-configuration-gdm))
(compose (service-extension localed-service-type
xorg-configuration-keyboard-layout (compose
gdm-configuration-xorg)))) xorg-configuration-keyboard-layout
gdm-configuration-xorg))))
;; For convenience, this service can be extended with an (default-value (gdm-configuration))
;; <xorg-configuration> record. Take the first one that (description
;; comes. "Run the GNOME Desktop Manager (GDM), a program that allows
(compose (lambda (extensions) you to log in in a graphical session, whether or not you use GNOME."))))
(match extensions
(() #f)
((config . _) config))))
(extend (lambda (config xorg-configuration)
(if xorg-configuration
(gdm-configuration
(inherit config)
(xorg-configuration xorg-configuration))
config)))
(default-value (gdm-configuration))
(description
"Run the GNOME Desktop Manager (GDM), a program that allows
you to log in in a graphical session, whether or not you use GNOME.")))
(define-deprecated (gdm-service #:key (gdm gdm) (define-deprecated (gdm-service #:key (gdm gdm)
(allow-empty-passwords? #t) (allow-empty-passwords? #t)