From c3343d62f682b33b1eefce74e9b08585faa8680c Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 25 Apr 2018 08:17:52 +0100 Subject: services: cgit: Improve handling of extra-options. * gnu/services/cgit.scm (serialize-cgit-configuration): Add the extra options, one per line, before the scan-path, as this makes it possible to use the extra-options to affect the global behaviour for repositories. (serialize-extra-options): New procedure. --- gnu/services/cgit.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gnu/services') diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm index 8ef12cd5a0..3183535d4a 100644 --- a/gnu/services/cgit.scm +++ b/gnu/services/cgit.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Oleg Pykhalov ;;; Copyright © 2018 Clément Lassieur +;;; Copyright © 2018 Christopher Baines ;;; ;;; This file is part of GNU Guix. ;;; @@ -169,6 +170,9 @@ 'project-list (plain-file "project-list" (string-join val "\n"))))) +(define (serialize-extra-options extra-options) + (string-join extra-options "\n" 'suffix)) + (define repository-directory? string?) (define (serialize-repository-directory _ val) @@ -641,6 +645,7 @@ for cgit to allow access to that repository.") (define (rest? field) (not (memq (configuration-field-name field) '(project-list + extra-options repository-directory repositories)))) #~(string-append @@ -649,6 +654,8 @@ for cgit to allow access to that repository.") #$(serialize-project-list 'project-list (cgit-configuration-project-list config)) + #$(serialize-extra-options + (cgit-configuration-extra-options config)) #$(serialize-repository-directory 'repository-directory (cgit-configuration-repository-directory config)) -- cgit v1.2.3 From 6ee3f3dec72f87187226bc11ff190f030169e55a Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 25 Apr 2018 08:18:38 +0100 Subject: services: cgit: Make project-list permit a file-object. Instead of having the service manage the list, it's useful to be able to point this at an existing file, for example, when using cgit together with gitolite. * gnu/services/cgit.scm (project-list?): New procedure. (serialize-project-list): Handle file-object values. (): Change the predicate for project-list to allow lists and file-objects. --- doc/guix.texi | 2 +- gnu/services/cgit.scm | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 005c0597ad..81ad4f48f1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19241,7 +19241,7 @@ Defaults to @samp{#f}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} list project-list +@deftypevr {@code{cgit-configuration} parameter} project-list project-list A list of subdirectories inside of @code{repository-directory}, relative to it, that should loaded as Git repositories. An empty list means that all subdirectories will be loaded. diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm index 3183535d4a..3289d37333 100644 --- a/gnu/services/cgit.scm +++ b/gnu/services/cgit.scm @@ -116,6 +116,10 @@ (define (serialize-file-object field-name val) (serialize-string field-name val)) +(define (project-list? val) + (or (list? val) + (file-object? val))) + ;;; ;;; Serialize @@ -168,7 +172,9 @@ (if (null? val) "" (serialize-field 'project-list - (plain-file "project-list" (string-join val "\n"))))) + (if (file-object? val) + val + (plain-file "project-list" (string-join val "\n")))))) (define (serialize-extra-options extra-options) (string-join extra-options "\n" 'suffix)) @@ -547,7 +553,7 @@ disabled.") "Flag which, when set to @samp{#t}, will make cgit omit the standard header on all pages.") (project-list - (list '()) + (project-list '()) "A list of subdirectories inside of @code{repository-directory}, relative to it, that should loaded as Git repositories. An empty list means that all subdirectories will be loaded.") -- cgit v1.2.3 From e9d271ed9a1fba86f372986a137b6110a41a1324 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sat, 10 Mar 2018 22:24:00 +0200 Subject: services: Add Enlightenment desktop service. * gnu/services/desktop.scm (, enlightenment-desktop-service-type): New variables. * doc/guix.texi (Desktop Services): Document the service. * NEWS: Mention it. --- NEWS | 7 ++++++ doc/guix.texi | 27 ++++++++++++++++----- gnu/services/desktop.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 6 deletions(-) (limited to 'gnu/services') diff --git a/NEWS b/NEWS index ca57f5d1fc..6003b5d577 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,13 @@ Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès Please send Guix bug reports to bug-guix@gnu.org. * Changes in 0.15.0 (since 0.14.0) + +** Distribution + +*** New services + +enlightenment + ** Programming interfaces *** package-full-name (guix packages) now uses "@" as its delimiter. diff --git a/doc/guix.texi b/doc/guix.texi index 81ad4f48f1..5129b998bd 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12678,11 +12678,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-type} 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 @@ -12695,7 +12695,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 binaries +are set as setuid, allowing Enlightenment's screen locker and other +functionality to work as expetected. The desktop environments in Guix use the Xorg display server by default. If you'd like to use the newer display server protocol @@ -12725,6 +12728,18 @@ profile, and extends polkit with the actions from @code{mate-settings-daemon}. @end deffn +@deffn {Scheme Procedure} enlightenment-desktop-service-type +Return a service that adds the @code{enlightenment} package to the system +profile, and extends dbus with actions from @code{efl}. +@end deffn + +@deftp {Data Type} enlightenment-desktop-service-configuration +@table @asis +@item @code{enlightenment} (default @code{enlightenment}) +The enlightenment package to use. +@end table +@end deftp + Because the GNOME, XFCE and MATE desktop services pull in so many packages, the default @code{%desktop-services} variable doesn't include any of them by default. To add GNOME, XFCE or MATE, just @code{cons} them onto diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 0dada82738..a9af7246f5 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. ;;; @@ -32,6 +33,7 @@ #:use-module (gnu services sound) #: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) @@ -45,9 +47,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) @@ -97,6 +101,10 @@ x11-socket-directory-service + enlightenment-desktop-configuration + enlightenment-desktop-configuration? + enlightenment-desktop-service-type + %desktop-services)) ;;; Commentary: @@ -900,6 +908,60 @@ 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/" + (match (string-tokenize (%current-system) + (char-set-complement (char-set #\-))) + ((arch "linux") (string-append "linux-gnu-" arch)) + ((arch "gnu") (string-append "gnu-" arch))) + "-" + (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)))) + (default-value (enlightenment-desktop-configuration)) + (description + "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 needs to function +as expected."))) ;;; -- cgit v1.2.3 From 9b0e51461d8170aaa5147fca33647371e8a8eb12 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 17 May 2018 21:15:46 +0300 Subject: services: connman: Add default configuration to the connman-service-type. * gnu/services/networking.scm (connman-service-type)[default-value]: New field. --- gnu/services/networking.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu/services') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 0c9c69eef5..6e71ccf8fe 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -959,6 +959,7 @@ wireless networking.")))) ;; Add connman to the system profile. (service-extension profile-service-type connman-package))) + (default-value (connman-configuration)) (description "Run @url{https://01.org/connman,Connman}, a network connection manager.")))) -- cgit v1.2.3 From 6a2b906565b677d62210d69d418ce150c202931b Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Fri, 18 May 2018 18:23:39 +0300 Subject: services: dbus: Search more directories for '.service' files. * gnu/services/dbus.scm (system-service-directory): Remove one level of directories when searching for '.service' files. --- gnu/services/dbus.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index 360a8af9ab..1e24d93ccb 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -63,7 +63,7 @@ all the services that may be activated by the daemon." (find-files (string-append service - "/share/dbus-1/system-services") + "/share/dbus-1/") "\\.service$")) (list #$@services))) -- cgit v1.2.3 From 19f20f4ffe88eb0ea3b0c88d1cf3ec43cda926c5 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Fri, 18 May 2018 18:25:07 +0300 Subject: services: openntpd: Add openntpd to the system profile. * gnu/services/networking.scm (openntpd-service-type): Extend the profile-service-type and add openntpd to the system profile. --- gnu/services/networking.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/services') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 6e71ccf8fe..a24342f237 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -464,6 +464,8 @@ make an initial adjustment of more than 1,000 seconds." openntpd-shepherd-service) (service-extension account-service-type (const %ntp-accounts)) + (service-extension profile-service-type + (compose list openntpd-configuration-openntpd)) (service-extension activation-service-type openntpd-service-activation))) (default-value (openntpd-configuration)) -- cgit v1.2.3 From d8ac79870132a00529825a09d73ad5cb7d2347bd Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Fri, 18 May 2018 18:26:03 +0300 Subject: services: connman: Add polkit hooks for connman. * gnu/services/networking.scm (connman-service-type): Extend the polkit-service-type with actions from connman. --- gnu/services/networking.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/services') diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index a24342f237..e4441f6475 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -954,6 +954,8 @@ wireless networking.")))) (extensions (list (service-extension shepherd-root-service-type connman-shepherd-service) + (service-extension polkit-service-type + connman-package) (service-extension dbus-root-service-type connman-package) (service-extension activation-service-type -- cgit v1.2.3