From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFlQd-0006wb-H5 for guix-patches@gnu.org; Mon, 07 May 2018 15:04:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fFlQY-0003zY-Ho for guix-patches@gnu.org; Mon, 07 May 2018 15:04:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:45284) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fFlQY-0003z9-DS for guix-patches@gnu.org; Mon, 07 May 2018 15:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fFlQX-00018H-Rj for guix-patches@gnu.org; Mon, 07 May 2018 15:04:01 -0400 Subject: [bug#31342] [PATCH 2/2] gnu: services: Add Enlightenment desktop service. Resent-Message-ID: Date: Mon, 7 May 2018 22:03:27 +0300 From: Efraim Flashner Message-ID: <20180507190327.GA2707@macbook41> References: <20180502164723.13994-1-efraim@flashner.co.il> <20180502164723.13994-2-efraim@flashner.co.il> <87bmdr5s2g.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BwCQnh7xodEAoBMC" Content-Disposition: inline In-Reply-To: <87bmdr5s2g.fsf@gnu.org> 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 31342@debbugs.gnu.org --BwCQnh7xodEAoBMC Content-Type: multipart/mixed; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 07, 2018 at 06:49:43PM +0200, Ludovic Court=C3=A8s wrote: > Efraim Flashner skribis: >=20 > > * gnu/services/desktop.scm (, > > enlightenment-desktop-service-type): New variables. > > (enlightenment-desktop-service): New public variable. > > * doc/guix.texi (Desktop Services): Document the service. >=20 > In guix.texi, could you document =E2=80=98enlightenment-desktop-service-t= ype=E2=80=99 > and =E2=80=98enlightenment-desktop-configuration=E2=80=99? >=20 > [...] >=20 > > +(define-record-type* > > + enlightenment-desktop-configuration > > + make-enlightenment-desktop-configuration > > + enlightenment-desktop-configuration > > + (enlightenment enlightenment-package (default enlightenment))) >=20 > Actually, unless you expect more configuration elements to be added to > this record eventually, you might be better off without a record and > simply using the package as the value for that service. >=20 > WDYT? >=20 > > +(define (enlightenment-setuid-programs enlightenment-desktop-configura= tion) > > + (match-record enlightenment-desktop-configuration > > + > > + (enlightenment) > > + (list (file-append enlightenment > > + "/lib/enlightenment/utils/enlightenment_sys") > > + (file-append enlightenment > > + "/lib/enlightenment/utils/enlightenment_backlig= ht") > > + ;; TODO: Move this binary to a screen-locker service. > > + (file-append enlightenment > > + "/lib/enlightenment/utils/enlightenment_ckpassw= d") >=20 > Perhaps enlightenment_ckpasswd needs a PAM entry as well, like > =E2=80=98screen-locker-service-type=E2=80=99 does? >=20 I'm not sure, enlightenment's screen locker code was refactored in 0.22.2 so that it would behave identically on Linux and BSD, and I'm not sure that the BSDs use PAM, and it seems to with as-is. > > + (file-append enlightenment > > + (string-append > > + "/lib/enlightenment/modules/cpufreq/linux-gnu= -" > > + (string-drop-right (%current-system) 6) ; dro= p '-linux' >=20 > Rather: >=20 > (match (string-tokenize (%current-system) (char-set-complement (char-se= t #\-))) > ((arch "linux") (string-append "linux-gnu-" arch)) > ((arch "gnu") (string-append "gnu-" arch))) >=20 > > +(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 t= o have > > +their setuid bit set." > > + (service enlightenment-desktop-service-type config)) >=20 > Not needed! :-) >=20 > Thank you, > Ludo=E2=80=99. I looked at the xfce service especially, and it actually has the same fields and declarations as enlightenment. I'd like to leave the option in place to add '(enlightenment-desktop-service)' to an OS-config since it is then identical to the other desktop services we have. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-gnu-services-Add-Enlightenment-desktop-service.patch" Content-Transfer-Encoding: quoted-printable =46rom 197db9e742508958a93a0ce606bd8a770f103745 Mon Sep 17 00:00:00 2001 =46rom: Efraim Flashner Date: Sat, 10 Mar 2018 22:24:00 +0200 Subject: [PATCH 1/2] gnu: services: Add Enlightenment desktop service. * 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 | 15 ++++++---- gnu/services/desktop.scm | 64 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index dc9894173..fca2c8e13 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}}). =20 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 @@ -12601,7 +12601,10 @@ To ``add MATE'' means that @code{polkit} and @code= {dbus} are extended appropriately, allowing MATE to operate with elevated privileges on a limited number of special-purpose system interfaces. Additionally, adding a service made by @code{mate-desktop-service} adds the MATE -metapackage to the system profile. +metapackage to the system profile. ``Adding ENLIGHTENMENT'' means that +@code{dbus} is extended appropriately, and several of Enlightenment's bina= ries +are set as setuid, allowing Enlightenment's screen locker and other +functionality to work as expetected. =20 The desktop environments in Guix use the Xorg display server by default. If you'd like to use the newer display server protocol diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 517d5d3ef..74073fab9 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -5,6 +5,7 @@ ;;; Copyright =C2=A9 2016 Sou Bunnbu ;;; Copyright =C2=A9 2017 Maxim Cournoyer ;;; Copyright =C2=A9 2017 Nils Gillmann +;;; Copyright =C2=A9 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 @@ =20 x11-socket-directory-service =20 + enlightenment-desktop-configuration + enlightenment-desktop-configuration? + enlightenment-desktop-service + enlightenment-desktop-service-type + %desktop-services)) =20 ;;; Commentary: @@ -899,6 +908,61 @@ with the administrator's password." (let ((directory "/tmp/.X11-unix")) (mkdir-p directory) (chmod directory #o777)))))) +=0C +;;; +;;; 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/" + (match (string-tokenize (%current-system) + (char-set-complement (cha= r-set #\-))) + ((arch "linux") (string-append "linux-gnu-= " arch)) + ((arch "gnu") (string-append "gnu-" arch= ))) + "-" + (version-major+minor (package-version enlightenme= nt)) + "/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 syst= em +profile, and extends dbus with the ability for @code{efl} to generate +thumbnails and makes setuid the programs which enlightenment needs to func= tion +as expected." + (service enlightenment-desktop-service-type config)) =20 =0C ;;; --=20 2.17.0 --LQksG6bCIzRHxTLp-- --BwCQnh7xodEAoBMC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlrwovcACgkQQarn3Mo9 g1EoRBAAk9ICtfja1f0XW4HbctNHEeKusC6j4+pRxAbbmK+K7YHSQx91HsXtjiDe yVQi56LCukP51eQNLabgXMIA63I1Zsg87brSew1jS9yIb0hDnR2qv1IIHyhzJlQF IC+IbYoz5Df+Si1UlreBSsSTNAL6PGX4TiiI4In2tUvl5c/3sDQNuDY5JK7q/+fK uXv86sPwIVKBXcL9/UjbD5uCOLCWOsWIDg4C15VdRg69Kg2Bk10IRxJ+5Jq79uGR 9DnBAKZbwsxaTvG75vdRLHQfmdv+m7NHUjboUu4zuk/q2C27Ya/sHG1g/NXIKSPL S4WkE9kqTtO9C3q3bWP5iH57DsFxkk9J661kGX12VxH+kHYUn/euuCeRDboQov/s R6lF035fAV81Lfemv+GkS1mcm2LB30AU0DOvjSoi2LO12I7BW1NFvTu4ozWi/u98 Rt8w1RrjX/jPu4s3gBhSxAWhb45kastDUCHJoxV/7EGvE2OSPfgAaz9eykQJYaK2 nayKbPZ8gSsEmc7Y1Ho9ebQaKj6JGbr498597Kp2VskWpyd5MT4RRKmXjaD0022z bQf4hLGeX2NKNLRxiIsV7e19b09y7KrQg+c2k8oEWzJqlf886i1anqmK+AEdmTD3 5Pgt0dLV5vpLHExqIAmAknkfNYxI6Vjlhd+/tt/+JPE3J3GU0oo= =tOmD -----END PGP SIGNATURE----- --BwCQnh7xodEAoBMC--