Package: guix-patches;
Reported by: Zheng Junjie <873216071 <at> qq.com>
Date: Sun, 23 Jul 2023 08:11:02 UTC
Severity: normal
Tags: patch
Done: 宋文武 <iyzsong <at> envs.net>
Bug is archived. No further changes may be made.
View this message in rfc822 format
From: Zheng Junjie <873216071 <at> qq.com> To: 64798 <at> debbugs.gnu.org Cc: Hartmut Goebel <h.goebel <at> crazy-compilers.com> Subject: [bug#64798] [PATCH 207/209] services: Add Plasme desktop service. Date: Sun, 23 Jul 2023 16:47:07 +0800
From: Hartmut Goebel <h.goebel <at> crazy-compilers.com> * gnu/services/desktop.scm (kde-desktop-service-type): New variable. (<kde-desktop-configuration>) : New record type, (kde-desktop-configuration): New procedure. * doc/guix.texi (Desktop Services): Document this. Co-authored-by: Zheng Junjie <873216071 <at> qq.com> --- doc/guix.texi | 18 ++++++++++++++ gnu/services/desktop.scm | 53 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 585baf358f..9be30bc2bf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -116,6 +116,7 @@ Copyright @copyright{} 2023 Karl Hallsby@* Copyright @copyright{} 2023 Nathaniel Nicandro@* Copyright @copyright{} 2023 Tanguy Le Carrour@* +Copyright @copyright{} 2023 Zheng Junjie@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -23721,6 +23722,23 @@ Desktop Services @end table @end deftp +@defvar plasma-desktop-service-type +This is the type of the service that adds the @uref{https://kde.org/plasma-desktop/, +Plasma} desktop environment. Its value is a @code{plasma-desktop-configuration} +object (see below). + +This service adds the @code{plasma} package to the system profile. +@end defvar + +@deftp {Data Type} plasma-desktop-configuration +Configuration record for the Plasma desktop environment. + +@table @asis +@item @code{plasma} (default: @code{plasma}) +The Plasma package to use. +@end table +@end deftp + @defvar xfce-desktop-service-type This is the type of a service to run the @uref{Xfce, https://xfce.org/} desktop environment. Its value is an @code{xfce-desktop-configuration} object diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 01aec64bee..92989b5cf7 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2016 Sou Bunnbu <iyzsong <at> gmail.com> ;;; Copyright © 2017, 2020, 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> ;;; Copyright © 2017 Nikita <nikita <at> n0.is> +;;; Copyright © 2017, 2019 Hartmut Goebel <h.goebel <at> crazy-compilers.com> ;;; Copyright © 2018, 2020, 2022 Efraim Flashner <efraim <at> flashner.co.il> ;;; Copyright © 2018, 2023 Ricardo Wurmus <rekado <at> elephly.net> ;;; Copyright © 2017, 2019 Christopher Baines <mail <at> cbaines.net> @@ -15,6 +16,7 @@ ;;; Copyright © 2021 Brice Waegeneire <brice <at> waegenei.re> ;;; Copyright © 2021, 2022 muradm <mail <at> muradm.net> ;;; Copyright © 2023 Bruno Victal <mirai <at> makinata.eu> +;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -55,6 +57,9 @@ (define-module (gnu services desktop) #:use-module (gnu packages cups) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gnome) + #:use-module (gnu packages kde) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages kde-plasma) #:use-module (gnu packages xfce) #:use-module (gnu packages avahi) #:use-module (gnu packages xdisorg) @@ -150,6 +155,10 @@ (define-module (gnu services desktop) sugar-desktop-configuration? sugar-desktop-service-type + plasma-desktop-configuration + plasma-desktop-configuration? + plasma-desktop-service-type + xfce-desktop-configuration xfce-desktop-configuration? xfce-desktop-service @@ -1625,6 +1634,50 @@ (define enlightenment-desktop-service-type thumbnails and makes setuid the programs which enlightenment needs to function as expected."))) +;;; +;;; KDE Plasma desktop service. +;;; + +(define-record-type* <plasma-desktop-configuration> plasma-desktop-configuration + make-plasma-desktop-configuration + plasma-desktop-configuration? + (plasma-package plasma-package (default plasma))) + +(define (plasma-polkit-settings config) + "Return the list of KDE Plasma dependencies that provide polkit actions and +rules." + (let ((plasma-plasma (plasma-package config))) + (map (lambda (name) + ((package-direct-input-selector name) plasma-plasma)) + '("plasma-desktop" + "plasma-workspace" + "plasma-disks" + "kinfocenter" + "libksysguard" + "ktexteditor" + "powerdevil" + "plasma-firewall")))) + +;; see https://bugs.kde.org/show_bug.cgi?id=456210 +;; if `kde' no exits, fallback to `other', and then unlock lockscreen not work, +;; so add it. +(define (plasma-pam-services config) + (list (unix-pam-service "kde"))) + +(define plasma-desktop-service-type + (service-type + (name 'plasma-desktop) + (description "") + (default-value (plasma-desktop-configuration)) + (extensions + (list (service-extension polkit-service-type + plasma-polkit-settings) + (service-extension pam-root-service-type + plasma-pam-services) + (service-extension profile-service-type + (compose list + plasma-package)))))) + ;;; ;;; inputattach-service-type -- 2.41.0
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.