[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/05: services: Add '%desktop-services'.

From: Ludovic Courtès
Subject: 03/05: services: Add '%desktop-services'.
Date: Fri, 08 May 2015 14:35:40 +0000

civodul pushed a commit to branch master
in repository guix.

commit 4467be213a93bab8f38ad5e4214dc947b8ca0bd1
Author: Ludovic Courtès <address@hidden>
Date:   Fri May 8 15:58:59 2015 +0200

    services: Add '%desktop-services'.
    * gnu/services/desktop.scm (%desktop-services): New variable.
    * doc/guix.texi (Desktop Services): Document it.
 doc/guix.texi            |   23 +++++++++++++++++++++++
 gnu/services/desktop.scm |   32 +++++++++++++++++++++++++++++++-
 2 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 8e36ce3..7504dea 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5005,6 +5005,29 @@ usually useful in the context of a ``desktop'' 
setup---that is, on a
 machine running a graphical display server, possibly with graphical user
 interfaces, etc.
+To simplify things, the module defines a variable containing the set of
+services that users typically expect on a machine with a graphical
+environment and networking:
address@hidden {Scheme Variable} %desktop-services
+This is a list of services that builds upon @var{%base-services} and
+adds or adjust services for a typical ``desktop'' setup.
+In particular, it adds a graphical login manager (@pxref{X Window,
address@hidden), a network management tool (@pxref{Networking
+Services, @code{wicd-service}}), energy and color management services,
+an NTP client and an SSH server (@pxref{Networking Services}), the Avahi
+daemon, and has the name service switch service configured to be able to
+use @code{nss-mdns} (@pxref{Name Service Switch, mDNS}).
address@hidden defvr
+The @var{%desktop-services} variable can be used as the @code{services}
+field of an @code{operating-system} declaration (@pxref{operating-system
+Reference, @code{services}}).
+The actual service definitions provided by @code{(gnu services desktop)}
+are described below.
 @deffn {Monadic Procedure} dbus-service @var{services} @
                          [#:dbus @var{dbus}]
 Return a service that runs the ``system bus'', using @var{dbus}, with
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 5945f7a..910dc1f 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -19,17 +19,25 @@
 (define-module (gnu services desktop)
   #:use-module (gnu services)
+  #:use-module (gnu services base)
+  #:use-module (gnu services avahi)
+  #:use-module (gnu services xorg)
+  #:use-module (gnu services networking)
+  #:use-module (gnu services ssh)
   #:use-module (gnu system shadow)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages avahi)
+  #:use-module (gnu packages wicd)
   #:use-module (guix monads)
   #:use-module (guix store)
   #:use-module (guix gexp)
   #:use-module (ice-9 match)
   #:export (dbus-service
-            colord-service))
+            colord-service
+            %desktop-services))
 ;;; Commentary:
@@ -267,4 +275,26 @@ site} for more information."
                              #~(string-append #$shadow "/sbin/nologin")))))))))
+(define %desktop-services
+  ;; List of services typically useful for a "desktop" use case.
+  (cons* (slim-service)
+         (avahi-service)
+         (wicd-service)
+         (upower-service)
+         (colord-service)
+         (dbus-service (list avahi wicd upower colord))
+         (ntp-service)
+         (lsh-service)
+         (map (lambda (mservice)
+                ;; Provide an nscd ready to use nss-mdns.
+                (mlet %store-monad ((service mservice))
+                  (if (memq 'nscd (service-provision service))
+                      (nscd-service (nscd-configuration)
+                                    #:name-services (list nss-mdns))
+                      mservice)))
+              %base-services)))
 ;;; desktop.scm ends here

reply via email to

[Prev in Thread] Current Thread [Next in Thread]