From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <guix-patches-bounces+larch=yhetil.org@gnu.org>
Received: from mp12.migadu.com ([2001:41d0:403:478a::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms9.migadu.com with LMTPS
	id 8EhqBwEbvWRJkgAASxT56A
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 23 Jul 2023 14:20:17 +0200
Received: from aspmx1.migadu.com ([2001:41d0:403:478a::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp12.migadu.com with LMTPS
	id WFoKBwEbvWT9OgEAauVa8A
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 23 Jul 2023 14:20:17 +0200
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id C70FD4A738
	for <larch@yhetil.org>; Sun, 23 Jul 2023 14:20:16 +0200 (CEST)
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("body hash did not verify") header.d=qq.com header.s=s201512 header.b="zTo5LxB/";
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org";
	dmarc=pass (policy=none) header.from=gnu.org
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1690114817;
	h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:resent-cc:
	 resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=ZxgNu7dCMo2Dv++BwRFyTxwRKGi8nAlH72X2dHtCRyc=;
	b=djvK8bQYpZCJRsBjlgUh0U0vuX+aWVm3AuJiVfBm3HQaXMszVDdLbSPpRJqU3nb/ciInPH
	RIzjqpeH/JMepSO8jzrsAVACtem/kBpQBkLhBn4KeZ21LQohLWXB2fGNm33ybBF5+3C/PD
	0MeJRGcUiVbGCYb7SEbqDO7L8x8bCgnI+06zMFalZ5CYLYnKp110lvx85xLni2W63QY7oT
	wtISxUa7cGlx19hHSholHe0/ApumkbwJOdt+Acqn2EjHniq6i2FRKRkZ8uNKRvK21tapVI
	rm+K6UsOQYsSr0PKX5BARhVszkU4Z8e7tQOtpkKeZjRgAO1TfMcZcqFzoRt2dw==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("body hash did not verify") header.d=qq.com header.s=s201512 header.b="zTo5LxB/";
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org";
	dmarc=pass (policy=none) header.from=gnu.org
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1690114817; a=rsa-sha256; cv=none;
	b=KAOvayvqPPq5fjwWCwKkGzTMJ1gpgzeBoZ7psCm1xzJydUTWggV1aMpFZRCeyURYZ4GDcu
	5FhWe9StfFRycdfMS+KV5ZyZzyI4KFElPmItDLb31NC9DS+UcWiHanO2lG41Nvl9lcXRMM
	51t1gDfGcloP1H6WtksFycxFoP7uq1CLM71+6CfCF0VFKdgzl/ZEk42bAnWcTwqj3RPekG
	RzQFI5qve1O8Gts/pS0pYX9bQqdQ2CMi1KCY5jz/5swiq1Kjc3kmODEMeHBl6gyxcCg7JY
	hGUVpACK6IbDa4AfzUm7juM5na3zWjd9KMUHCvQ5ubeFcjc66lysWUzXfg+ZaQ==
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-patches-bounces@gnu.org>)
	id 1qNY4B-0003KO-UR; Sun, 23 Jul 2023 08:20:03 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1qNY4A-0003KD-My
 for guix-patches@gnu.org; Sun, 23 Jul 2023 08:20:02 -0400
Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1qNY4A-0002q3-EH
 for guix-patches@gnu.org; Sun, 23 Jul 2023 08:20:02 -0400
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qNY4A-0007JW-9u
 for guix-patches@gnu.org; Sun, 23 Jul 2023 08:20:02 -0400
X-Loop: help-debbugs@gnu.org
Subject: [bug#64798] [PATCH 207/209] services: Add Plasme desktop service.
Resent-From: Zheng Junjie <873216071@qq.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: guix-patches@gnu.org
Resent-Date: Sun, 23 Jul 2023 12:20:02 +0000
Resent-Message-ID: <handler.64798.B64798.169011475128054@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 64798
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 64798@debbugs.gnu.org
Cc: Hartmut Goebel <h.goebel@crazy-compilers.com>
Received: via spool by 64798-submit@debbugs.gnu.org id=B64798.169011475128054
 (code B ref 64798); Sun, 23 Jul 2023 12:20:02 +0000
Received: (at 64798) by debbugs.gnu.org; 23 Jul 2023 12:19:11 +0000
Received: from localhost ([127.0.0.1]:38973 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1qNY3K-0007IP-Ag
 for submit@debbugs.gnu.org; Sun, 23 Jul 2023 08:19:10 -0400
Received: from out162-62-57-87.mail.qq.com ([162.62.57.87]:47733)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <873216071@qq.com>) id 1qNY3G-0007Hq-6n
 for 64798@debbugs.gnu.org; Sun, 23 Jul 2023 08:19:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512;
 t=1690114437; bh=aYRIF+DoJs7fJ9W/kLRKKDSu2RkusXPrvqExZU2wblM=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References;
 b=zTo5LxB/UBnDs+RQN7p2UK0L0MgYbpU0725v+NblFToxTDHKfwWJFDcdWyIYMYouU
 fwlqXvE+7FOyHGku0EvAxosj7jpQ8T3leJO58+wG4mweohGlDDIlhzVLASwgJI89Mr
 KO1Kio6z1pAhmiYTqTv43TwCEeE0uczqZHN1j7T8=
Received: from localhost.localdomain ([111.0.51.236])
 by newxmesmtplogicsvrszc5-0.qq.com (NewEsmtp) with SMTP
 id 37312C61; Sun, 23 Jul 2023 20:13:51 +0800
X-QQ-mid: xmsmtpt1690114435txc5dey9v
Message-ID: <tencent_C208B5629B02A99D59087F3C3ACCE5212508@qq.com>
X-QQ-XMAILINFO: MpO6L0LObisWC0FfWjGgJK/H/RdbZyRW9f7O+X+OIgHt/WByOnrbvJHlFnbjLG
 MN7yaaBZC8SQTFtTW+w8hvAdmvqF0zVhcjdf9SZI/jWMAUY+lZh0Nkiw3GGgTrSJEuQF4XuJ/Wzn
 fl42kHdQfGQhzcr6voKZH++Qbsw5TJ2XhJ5DFcQqpMZpTY/AqPXxMkbCuslGF8rbOKdLFD389ECz
 XVEMoWIlustIhkPrgbNLkQfX1g17aghryAyZFLJb5fCda7IT2csAHlhekhTWYrrzYlm01rvmMipv
 fn4j0gAKOoU/CH50/ycS2Z4hnwgilNcm0DYLnPacY0FiDaX6qg0gCCGy2cYhSqP6voTi3eoJxcBk
 6JgZ1G0FrrnkneQK5zBCdYahyR/F9aUyPxInP2NP1rV879vk9ekE5mg3oMCDi42ZO6rkJHLQgDVf
 pR6obT9Ro1EGab8pWrXsVIIbM5YtpUgusglqeZwks1ap0iiysEUHRJTan/d8zGPc1J5NVXqek7Ey
 +WD8U+zJcFpBEga0r31FPykPXJiuWHOfAR7sB/BUhlUKQ/RO/gURyfvLrC4vX/ofZHE9p3VQc5NM
 XJim1EHQywij5/yOHPre92cpTCEFIgaTGrmF2CJ6EG2l5kaGzSYxqxlecEPi3wk38KgLHKUgFN8i
 NX5GmQ7BI3gBKaoTXSOcC3ETT4bse8lS3dqd1Zb0qYEdA+/7tASvmHZqzxdEynPTZCOLrVvxyaNM
 0nK6FupFougFguat63YIcXm8HJrYHM1DGK0LSuRBJs++7mXAsp2GZrp+GkHOKz/MIXWlF8pkDXEs
 HokH7awwfIcBmMOlnu3N/RWWzCIPlXIwmtzRjOMaXqkGnkiOwn2OiBgtNmpYqcCmxV2R/SBeCt6Z
 Ly115ZzADT8y7PbV/LXB6UgF9vYhrTLS4+HPhyNKjf5VkJyMTMyVdJGEYj5Y3xeJI9evkiN0Osb/
 ZVy4o/pP3bi5yYU58EQs3+pFwEflvo8uOAkUxPvYTlvaUoEa+BUyRLJvUwLzII
X-QQ-XMRINFO: MPJ6Tf5t3I/ycC2BItcBVIA=
Date: Sun, 23 Jul 2023 16:47:07 +0800
X-OQ-MSGID: <0bccec3d9daf04b0b7c4a3d3841085b3c13bf1e5.1690099027.git.873216071@qq.com>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1690099026.git.873216071@qq.com>
References: <cover.1690099026.git.873216071@qq.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=y
Content-Transfer-Encoding: 8bit
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: guix-patches@gnu.org
List-Id: <guix-patches.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/guix-patches>
List-Post: <mailto:guix-patches@gnu.org>
List-Help: <mailto:guix-patches-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=subscribe>
Reply-to:  Zheng Junjie <873216071@qq.com>
X-ACL-Warn: ,  Zheng Junjie via Guix-patches <guix-patches@gnu.org>
From:  Zheng Junjie via Guix-patches via <guix-patches@gnu.org>
Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org
Sender: guix-patches-bounces+larch=yhetil.org@gnu.org
X-Migadu-Flow: FLOW_IN
X-Migadu-Country: US
X-Spam-Score: -6.65
X-Migadu-Queue-Id: C70FD4A738
X-Migadu-Spam-Score: -6.65
X-Migadu-Scanner: mx0.migadu.com
X-TUID: 4kLickzhB38l

From: Hartmut Goebel <h.goebel@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@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@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 @@ (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