me
/
guix
Archived
1
0
Fork 0

services: Modularise gnome-desktop-configuration.

* gnu/services/gnome.scm (extract-propagated-inputs): New variable.
(gnome-desktop-configuration): Add ‘core-services’, ‘shell’, ‘utilities’,
and ‘extra-packages’.  Deprecate ‘gnome’.
(gnome-desktop-configuration-core-services, gnome-desktop-configuration-shell)
(gnome-desktop-configuration-utilities)
(gnome-desktop-configuration-extra-packages): Export publicly.
(gnome-udev-rules, gnome-polkit-settings): Adjust accordingly.
(gnome-profile): New variable.
(gnome-desktop-service-type): Adjust accordingly.
master
Liliana Marie Prikler 2024-01-25 16:35:17 +01:00
parent 0bce55ca53
commit 523f3def65
No known key found for this signature in database
GPG Key ID: 442A84B8C70E2F87
1 changed files with 83 additions and 14 deletions

View File

@ -37,6 +37,7 @@
#:use-module (gnu services) #:use-module (gnu services)
#:use-module (gnu services shepherd) #:use-module (gnu services shepherd)
#:use-module (gnu services base) #:use-module (gnu services base)
#:use-module (gnu services configuration)
#:use-module (gnu services dbus) #:use-module (gnu services dbus)
#:use-module (gnu services avahi) #:use-module (gnu services avahi)
#:use-module (gnu services xorg) #:use-module (gnu services xorg)
@ -60,6 +61,7 @@
#:use-module (gnu packages kde) #:use-module (gnu packages kde)
#:use-module (gnu packages kde-frameworks) #:use-module (gnu packages kde-frameworks)
#:use-module (gnu packages kde-plasma) #:use-module (gnu packages kde-plasma)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages xfce) #:use-module (gnu packages xfce)
#:use-module (gnu packages avahi) #:use-module (gnu packages avahi)
#:use-module (gnu packages xdisorg) #:use-module (gnu packages xdisorg)
@ -73,6 +75,7 @@
#:use-module (gnu packages nfs) #:use-module (gnu packages nfs)
#:use-module (gnu packages enlightenment) #:use-module (gnu packages enlightenment)
#:use-module (guix deprecation) #:use-module (guix deprecation)
#:use-module (guix diagnostics)
#:use-module (guix records) #:use-module (guix records)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix store) #:use-module (guix store)
@ -81,6 +84,7 @@
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:use-module (srfi srfi-26) #:use-module (srfi srfi-26)
#:use-module (srfi srfi-35)
#:use-module (ice-9 format) #:use-module (ice-9 format)
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:export (<upower-configuration> #:export (<upower-configuration>
@ -139,6 +143,10 @@
gnome-desktop-configuration gnome-desktop-configuration
gnome-desktop-configuration? gnome-desktop-configuration?
gnome-desktop-configuration-core-services
gnome-desktop-configuration-shell
gnome-desktop-configuration-utilities
gnome-desktop-configuration-extra-packages
gnome-desktop-service gnome-desktop-service
gnome-desktop-service-type gnome-desktop-service-type
@ -1382,11 +1390,34 @@ rules.")
;;; GNOME desktop service. ;;; GNOME desktop service.
;;; ;;;
(define-record-type* <gnome-desktop-configuration> gnome-desktop-configuration (define-maybe/no-serialization package)
make-gnome-desktop-configuration
gnome-desktop-configuration? (define (extract-propagated-inputs package)
(gnome gnome-desktop-configuration-gnome ;; Drop input labels. Attempt to support outputs.
(default gnome))) (map
(match-lambda
((_ (? package? pkg)) pkg)
((_ (? package? pkg) output) (list pkg output)))
(package-propagated-inputs package)))
(define-configuration/no-serialization gnome-desktop-configuration
(core-services
(list-of-packages (extract-propagated-inputs gnome-meta-core-services))
"A list of packages that the GNOME Shell and applications may rely on.")
(shell
(list-of-packages (extract-propagated-inputs gnome-meta-core-shell))
"A list of packages that constitute the GNOME Shell, without applications.")
(utilities
(list-of-packages (extract-propagated-inputs gnome-meta-core-utilities))
"A list of packages that serve as applications to use on top of the \
GNOME Shell.")
(gnome (maybe-package) "Deprecated. Do not use.")
(extra-packages
(list-of-packages (extract-propagated-inputs gnome-essential-extras))
"A list of GNOME-adjacent packages to also include. This field is intended
for users to add their own packages to their GNOME experience. Note, that it
already includes some packages that are considered essential by some (most?)
GNOME users."))
(define (gnome-package gnome name) (define (gnome-package gnome name)
"Return the package NAME among the GNOME package inputs. NAME can be a "Return the package NAME among the GNOME package inputs. NAME can be a
@ -1400,18 +1431,56 @@ denote the spice-gtk input of the gnome-boxes input of the GNOME meta-package."
(define (gnome-udev-rules config) (define (gnome-udev-rules config)
"Return the list of GNOME dependencies that provide udev rules." "Return the list of GNOME dependencies that provide udev rules."
(let ((gnome (gnome-desktop-configuration-gnome config))) (let* ((gnome (gnome-desktop-configuration-gnome config))
(gnome-packages gnome '("gnome-settings-daemon")))) (shell (gnome-desktop-configuration-shell config)))
(or (any (match-lambda
((and pkg (= package-name "gnome-settings-daemon"))
(list pkg))
(_ #f))
shell)
(and (maybe-value-set? gnome)
(gnome-packages gnome '("gnome-settings-daemon")))
(raise
(condition
(&error-location
(location (gnome-desktop-configuration-source-location config)))
(&message (message (G_ "Missing gnome-settings-daemon"))))))))
(define (gnome-polkit-settings config) (define (gnome-polkit-settings config)
"Return the list of GNOME dependencies that provide polkit actions and "Return the list of GNOME dependencies that provide polkit actions and
rules." rules."
(let ((gnome (gnome-desktop-configuration-gnome config))) (let ((gnome (gnome-desktop-configuration-gnome config))
(gnome-packages gnome (shell (gnome-desktop-configuration-shell config)))
'("gnome-settings-daemon" (or (any (match-lambda ((and pkg (= package-name "gvfs")) (list pkg))
"gnome-control-center" (_ #f))
"gnome-system-monitor" shell)
"gvfs")))) (and (maybe-value-set? gnome)
(gnome-packages gnome
'("gnome-settings-daemon"
"gnome-control-center"
"gnome-system-monitor"
"gvfs")))
(raise
(condition
(&error-location
(location (gnome-desktop-configuration-source-location config)))
(&message (message (G_ "Missing gvfs"))))))))
(define (gnome-profile config)
"Return a list of packages propagated through CONFIG."
(append
(gnome-desktop-configuration-core-services config)
(gnome-desktop-configuration-shell config)
(gnome-desktop-configuration-utilities config)
(let ((gnome-meta (gnome-desktop-configuration-gnome config)))
(if (maybe-value-set? gnome-meta)
(begin
(warning
(gnome-desktop-configuration-source-location config)
(G_ "Using a meta-package for gnome-desktop is discouraged.~%"))
(list gnome-meta))
(list)))
(gnome-desktop-configuration-extra-packages config)))
(define gnome-desktop-service-type (define gnome-desktop-service-type
(service-type (service-type
@ -1422,7 +1491,7 @@ rules."
(service-extension polkit-service-type (service-extension polkit-service-type
gnome-polkit-settings) gnome-polkit-settings)
(service-extension profile-service-type (service-extension profile-service-type
(compose list gnome-desktop-configuration-gnome)))) gnome-profile)))
(default-value (gnome-desktop-configuration)) (default-value (gnome-desktop-configuration))
(description "Run the GNOME desktop environment."))) (description "Run the GNOME desktop environment.")))