summaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
author宋文武 <iyzsong@member.fsf.org>2023-08-19 05:02:00 +0800
committer宋文武 <iyzsong@member.fsf.org>2023-08-19 05:02:00 +0800
commit597af70fd24eb85a85fa8c45008c9cfa241f4d0b (patch)
tree981c2f4cb803f5a3d33d50f132ecc114373c17a0 /gnu/services
parent0d70012efb3d19cf9ba955b5df493f193af0ca7e (diff)
parentf3f02dd9c8dce60db0abd84100000edc0b07b6c1 (diff)
Merge branch 'kde-updates'
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/desktop.scm53
-rw-r--r--gnu/services/sddm.scm11
2 files changed, 63 insertions, 1 deletions
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 4996d1a3d9..5b79fbcda1 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2017, 2020, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2017 Nikita <nikita@n0.is>
+;;; Copyright © 2017, 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2018, 2020, 2022 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018, 2023 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net>
@@ -15,6 +16,7 @@
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2021, 2022 muradm <mail@muradm.net>
;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
+;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -55,6 +57,9 @@
#: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 @@
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
@@ -1629,6 +1638,50 @@ profile, and extends dbus with the ability for @code{efl} to generate
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 "Run the KDE Plasma desktop environment.")
+ (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
diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm
index c9a7ba96f4..69c737829b 100644
--- a/gnu/services/sddm.scm
+++ b/gnu/services/sddm.scm
@@ -171,7 +171,16 @@ Relogin=" (if (sddm-configuration-relogin? config)
(documentation "SDDM display manager.")
(requirement '(user-processes elogind pam))
(provision '(xorg-server display-manager))
- (start #~(make-forkexec-constructor #$sddm-command))
+ (start #~(make-forkexec-constructor
+ #$sddm-command
+ ;; some theme need icon,qml,data so add path to env.
+ #:environment-variables
+ (cons*
+ "XDG_DATA_DIRS=/run/current-system/profile/share"
+ "XDG_CONFIG_DIRS=/run/current-system/profile/etc/xdg"
+ "QT_PLUGIN_PATH=/run/current-system/profile/lib/qt5/plugins"
+ "QML2_IMPORT_PATH=/run/current-system/profile/lib/qt5/qml"
+ (default-environment-variables))))
(stop #~(make-kill-destructor)))))
(define (sddm-etc-service config)