From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDuvF-0006i0-S8 for guix-patches@gnu.org; Wed, 02 May 2018 12:48:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDuvC-0005MZ-W1 for guix-patches@gnu.org; Wed, 02 May 2018 12:48:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:39364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fDuvC-0005MJ-OL for guix-patches@gnu.org; Wed, 02 May 2018 12:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fDuvC-0005jE-Hz for guix-patches@gnu.org; Wed, 02 May 2018 12:48:02 -0400 Subject: [bug#31342] [PATCH 2/2] gnu: services: Add Enlightenment desktop service. Resent-Message-ID: From: Efraim Flashner Date: Wed, 2 May 2018 19:47:23 +0300 Message-Id: <20180502164723.13994-2-efraim@flashner.co.il> In-Reply-To: <20180502164723.13994-1-efraim@flashner.co.il> References: <20180502164723.13994-1-efraim@flashner.co.il> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31342@debbugs.gnu.org Cc: Efraim Flashner * gnu/services/desktop.scm (, enlightenment-desktop-service-type): New variables. (enlightenment-desktop-service): New public variable. * doc/guix.texi (Desktop Services): Document the service. --- doc/guix.texi | 10 +++---- gnu/services/desktop.scm | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index dc9894173..4fd3464ad 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12584,11 +12584,11 @@ field of an @code{operating-system} declaration (@pxref{operating-system Reference, @code{services}}). Additionally, the @code{gnome-desktop-service}, -@code{xfce-desktop-service} and @code{mate-desktop-service} -procedures can add GNOME, XFCE and/or MATE to a system. -To ``add GNOME'' means that system-level services like the -backlight adjustment helpers and the power management utilities are -added to the system, extending @code{polkit} and @code{dbus} +@code{xfce-desktop-service}, @code{mate-desktop-service} and +@code{enlightenment-desktop-service} procedures can add GNOME, XFCE, MATE +and/or Enlightenment to a system. To ``add GNOME'' means that system-level +services like the backlight adjustment helpers and the power management +utilities are added to the system, extending @code{polkit} and @code{dbus} appropriately, allowing GNOME to operate with elevated privileges on a limited number of special-purpose system interfaces. Additionally, adding a service made by @code{gnome-desktop-service} adds the GNOME diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 517d5d3ef..605d06c23 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2016 Sou Bunnbu ;;; Copyright © 2017 Maxim Cournoyer ;;; Copyright © 2017 Nils Gillmann +;;; Copyright © 2018 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -31,6 +32,7 @@ #:use-module (gnu services networking) #:use-module ((gnu system file-systems) #:select (%elogind-file-systems)) + #:use-module (gnu system) #:use-module (gnu system shadow) #:use-module (gnu system pam) #:use-module (gnu packages glib) @@ -44,9 +46,11 @@ #:use-module (gnu packages linux) #:use-module (gnu packages libusb) #:use-module (gnu packages mate) + #:use-module (gnu packages enlightenment) #:use-module (guix records) #:use-module (guix packages) #:use-module (guix store) + #:use-module (guix utils) #:use-module (guix gexp) #:use-module (srfi srfi-1) #:use-module (ice-9 match) @@ -96,6 +100,11 @@ x11-socket-directory-service + enlightenment-desktop-configuration + enlightenment-desktop-configuration? + enlightenment-desktop-service + enlightenment-desktop-service-type + %desktop-services)) ;;; Commentary: @@ -899,6 +908,58 @@ with the administrator's password." (let ((directory "/tmp/.X11-unix")) (mkdir-p directory) (chmod directory #o777)))))) + +;;; +;;; Enlightenment desktop service. +;;; + +(define-record-type* + enlightenment-desktop-configuration + make-enlightenment-desktop-configuration + enlightenment-desktop-configuration + (enlightenment enlightenment-package (default enlightenment))) + +(define (enlightenment-setuid-programs enlightenment-desktop-configuration) + (match-record enlightenment-desktop-configuration + + (enlightenment) + (list (file-append enlightenment + "/lib/enlightenment/utils/enlightenment_sys") + (file-append enlightenment + "/lib/enlightenment/utils/enlightenment_backlight") + ;; TODO: Move this binary to a screen-locker service. + (file-append enlightenment + "/lib/enlightenment/utils/enlightenment_ckpasswd") + (file-append enlightenment + (string-append + "/lib/enlightenment/modules/cpufreq/linux-gnu-" + (string-drop-right (%current-system) 6) ; drop '-linux' + "-" + (version-major+minor (package-version enlightenment)) + "/freqset"))))) + +(define enlightenment-desktop-service-type + (service-type + (name 'enlightenment-desktop) + (extensions + (list (service-extension dbus-root-service-type + (compose list + (package-direct-input-selector + "efl") + enlightenment-package)) + (service-extension setuid-program-service-type + enlightenment-setuid-programs) + (service-extension profile-service-type + (compose list + enlightenment-package)))))) + +(define* (enlightenment-desktop-service + #:key (config (enlightenment-desktop-configuration))) + "Return a service that adds the @code{enlightenment} package to the system +profile, and extends dbus with the ability for @code{efl} to generate +thumbnails and makes setuid the programs which enlightenment expects to have +their setuid bit set." + (service enlightenment-desktop-service-type config)) ;;; -- 2.17.0