Next: , Previous: , Up: Services   [Contents][Index]


10.8.8 Desktop Services

The (gnu services desktop) module provides services that are 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. It also defines services that provide specific desktop environments like GNOME, Xfce or MATE.

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:

Scheme Variable: %desktop-services

This is a list of services that builds upon %base-services and adds or adjusts services for a typical “desktop” setup.

In particular, it adds a graphical login manager (see gdm-service-type), screen lockers, a network management tool (see network-manager-service-type) with modem support (see modem-manager-service-type), energy and color management services, the elogind login and seat manager, the Polkit privilege service, the GeoClue location service, the AccountsService daemon that allows authorized users change system passwords, an NTP client (see Networking Services), the Avahi daemon, and has the name service switch service configured to be able to use nss-mdns (see mDNS).

The %desktop-services variable can be used as the services field of an operating-system declaration (see services).

Additionally, the gnome-desktop-service-type, xfce-desktop-service, mate-desktop-service-type, lxqt-desktop-service-type and 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 polkit and dbus appropriately, allowing GNOME to operate with elevated privileges on a limited number of special-purpose system interfaces. Additionally, adding a service made by gnome-desktop-service-type adds the GNOME metapackage to the system profile. Likewise, adding the Xfce service not only adds the xfce metapackage to the system profile, but it also gives the Thunar file manager the ability to open a “root-mode” file management window, if the user authenticates using the administrator’s password via the standard polkit graphical interface. To “add MATE” means that polkit and dbus are extended appropriately, allowing MATE to operate with elevated privileges on a limited number of special-purpose system interfaces. Additionally, adding a service of type mate-desktop-service-type adds the MATE metapackage to the system profile. “Adding Enlightenment” means that 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 expected.

The desktop environments in Guix use the Xorg display server by default. If you’d like to use the newer display server protocol called Wayland, you need to use the sddm-service instead of GDM as the graphical login manager. You should then select the “GNOME (Wayland)” session in SDDM. Alternatively you can also try starting GNOME on Wayland manually from a TTY with the command “XDG_SESSION_TYPE=wayland exec dbus-run-session gnome-session“. Currently only GNOME has support for Wayland.

Scheme Variable: gnome-desktop-service-type

This is the type of the service that adds the GNOME desktop environment. Its value is a gnome-desktop-configuration object (see below).

This service adds the gnome package to the system profile, and extends polkit with the actions from gnome-settings-daemon.

Data Type: gnome-desktop-configuration

Configuration record for the GNOME desktop environment.

gnome (default: gnome)

The GNOME package to use.

Scheme Variable: xfce-desktop-service-type

This is the type of a service to run the https://xfce.org/ desktop environment. Its value is an xfce-desktop-configuration object (see below).

This service adds the xfce package to the system profile, and extends polkit with the ability for thunar to manipulate the file system as root from within a user session, after the user has authenticated with the administrator’s password.

Note that xfce4-panel and its plugin packages should be installed in the same profile to ensure compatibility. When using this service, you should add extra plugins (xfce4-whiskermenu-plugin, xfce4-weather-plugin, etc.) to the packages field of your operating-system.

Data Type: xfce-desktop-configuration

Configuration record for the Xfce desktop environment.

xfce (default: xfce)

The Xfce package to use.

Scheme Variable: mate-desktop-service-type

This is the type of the service that runs the MATE desktop environment. Its value is a mate-desktop-configuration object (see below).

This service adds the mate package to the system profile, and extends polkit with the actions from mate-settings-daemon.

Data Type: mate-desktop-configuration

Configuration record for the MATE desktop environment.

mate (default: mate)

The MATE package to use.

Scheme Variable: lxqt-desktop-service-type

This is the type of the service that runs the LXQt desktop environment. Its value is a lxqt-desktop-configuration object (see below).

This service adds the lxqt package to the system profile.

Data Type: lxqt-desktop-configuration

Configuration record for the LXQt desktop environment.

lxqt (default: lxqt)

The LXQT package to use.

Scheme Variable: enlightenment-desktop-service-type

Return a service that adds the enlightenment package to the system profile, and extends dbus with actions from efl.

Data Type: enlightenment-desktop-service-configuration
enlightenment (default: enlightenment)

The enlightenment package to use.

Because the GNOME, Xfce and MATE desktop services pull in so many packages, the default %desktop-services variable doesn’t include any of them by default. To add GNOME, Xfce or MATE, just cons them onto %desktop-services in the services field of your operating-system:

(use-modules (gnu))
(use-service-modules desktop)
(operating-system
  ...
  ;; cons* adds items to the list given as its last argument.
  (services (cons* (service gnome-desktop-service-type)
                   (service xfce-desktop-service)
                   %desktop-services))
  ...)

These desktop environments will then be available as options in the graphical login window.

The actual service definitions included in %desktop-services and provided by (gnu services dbus) and (gnu services desktop) are described below.

Scheme Procedure: dbus-service [#:dbus dbus] [#:services '()]

Return a service that runs the “system bus”, using dbus, with support for services.

D-Bus is an inter-process communication facility. Its system bus is used to allow system services to communicate and to be notified of system-wide events.

services must be a list of packages that provide an etc/dbus-1/system.d directory containing additional D-Bus configuration and policy files. For example, to allow avahi-daemon to use the system bus, services must be equal to (list avahi).

Scheme Procedure: elogind-service [#:config config]

Return a service that runs the elogind login and seat management daemon. Elogind exposes a D-Bus interface that can be used to know which users are logged in, know what kind of sessions they have open, suspend the system, inhibit system suspend, reboot the system, and other tasks.

Elogind handles most system-level power events for a computer, for example suspending the system when a lid is closed, or shutting it down when the power button is pressed.

The config keyword argument specifies the configuration for elogind, and should be the result of an (elogind-configuration (parameter value)...) invocation. Available parameters and their default values are:

kill-user-processes?

#f

kill-only-users

()

kill-exclude-users

("root")

inhibit-delay-max-seconds

5

handle-power-key

poweroff

handle-suspend-key

suspend

handle-hibernate-key

hibernate

handle-lid-switch

suspend

handle-lid-switch-docked

ignore

handle-lid-switch-external-power

ignore

power-key-ignore-inhibited?

#f

suspend-key-ignore-inhibited?

#f

hibernate-key-ignore-inhibited?

#f

lid-switch-ignore-inhibited?

#t

holdoff-timeout-seconds

30

idle-action

ignore

idle-action-seconds

(* 30 60)

runtime-directory-size-percent

10

runtime-directory-size

#f

remove-ipc?

#t

suspend-state

("mem" "standby" "freeze")

suspend-mode

()

hibernate-state

("disk")

hibernate-mode

("platform" "shutdown")

hybrid-sleep-state

("disk")

hybrid-sleep-mode

("suspend" "platform" "shutdown")

Scheme Procedure: accountsservice-service [#:accountsservice accountsservice]

Return a service that runs AccountsService, a system service that can list available accounts, change their passwords, and so on. AccountsService integrates with PolicyKit to enable unprivileged users to acquire the capability to modify their system configuration. the accountsservice web site for more information.

The accountsservice keyword argument is the accountsservice package to expose as a service.

Scheme Procedure: polkit-service [#:polkit polkit]

Return a service that runs the Polkit privilege management service, which allows system administrators to grant access to privileged operations in a structured way. By querying the Polkit service, a privileged system component can know when it should grant additional capabilities to ordinary users. For example, an ordinary user can be granted the capability to suspend the system if the user is logged in locally.

Scheme Variable: polkit-wheel-service

Service that adds the wheel group as admins to the Polkit service. This makes it so that users in the wheel group are queried for their own passwords when performing administrative actions instead of root’s, similar to the behaviour used by sudo.

Scheme Variable: upower-service-type

Service that runs upowerd, a system-wide monitor for power consumption and battery levels, with the given configuration settings.

It implements the org.freedesktop.UPower D-Bus interface, and is notably used by GNOME.

Data Type: upower-configuration

Data type representation the configuration for UPower.

upower (default: upower)

Package to use for upower.

watts-up-pro? (default: #f)

Enable the Watts Up Pro device.

poll-batteries? (default: #t)

Enable polling the kernel for battery level changes.

ignore-lid? (default: #f)

Ignore the lid state, this can be useful if it’s incorrect on a device.

use-percentage-for-policy? (default: #f)

Whether battery percentage based policy should be used. The default is to use the time left, change to #t to use the percentage.

percentage-low (default: 10)

When use-percentage-for-policy? is #t, this sets the percentage at which the battery is considered low.

percentage-critical (default: 3)

When use-percentage-for-policy? is #t, this sets the percentage at which the battery is considered critical.

percentage-action (default: 2)

When use-percentage-for-policy? is #t, this sets the percentage at which action will be taken.

time-low (default: 1200)

When use-time-for-policy? is #f, this sets the time remaining in seconds at which the battery is considered low.

time-critical (default: 300)

When use-time-for-policy? is #f, this sets the time remaining in seconds at which the battery is considered critical.

time-action (default: 120)

When use-time-for-policy? is #f, this sets the time remaining in seconds at which action will be taken.

critical-power-action (default: 'hybrid-sleep)

The action taken when percentage-action or time-action is reached (depending on the configuration of use-percentage-for-policy?).

Possible values are:

  • 'power-off
  • 'hibernate
  • 'hybrid-sleep.
Scheme Procedure: udisks-service [#:udisks udisks]

Return a service for UDisks, a disk management daemon that provides user interfaces with notifications and ways to mount/unmount disks. Programs that talk to UDisks include the udisksctl command, part of UDisks, and GNOME Disks. Note that Udisks relies on the mount command, so it will only be able to use the file-system utilities installed in the system profile. For example if you want to be able to mount NTFS file-systems in read and write fashion, you’ll need to have ntfs-3g installed system-wide.

Scheme Variable: colord-service-type

This is the type of the service that runs colord, a system service with a D-Bus interface to manage the color profiles of input and output devices such as screens and scanners. It is notably used by the GNOME Color Manager graphical tool. See the colord web site for more information.

Scheme Variable: sane-service-type

This service provides access to scanners via SANE by installing the necessary udev rules. It is included in %desktop-services (see Desktop Services) and relies by default on sane-backends-minimal package (see below) for hardware support.

Scheme Variable: sane-backends-minimal

The default package which the sane-service-type installs. It supports many recent scanners.

Scheme Variable: sane-backends

This package includes support for all scanners that sane-backends-minimal supports, plus older Hewlett-Packard scanners supported by hplip package. In order to use this on a system which relies on %desktop-services, you may use modify-services (see modify-services) as illustrated below:

(use-modules (gnu))
(use-service-modules
  …
  desktop)
(use-package-modules
  …
  scanner)

(define %my-desktop-services
  ;; List of desktop services that supports a broader range of scanners.
  (modify-services %desktop-services
    (sane-service-type _ => sane-backends)))

(operating-system
  …
  (services %my-desktop-services)
Scheme Procedure: geoclue-application name [#:allowed? #t] [#:system? #f] [#:users '()]

Return a configuration allowing an application to access GeoClue location data. name is the Desktop ID of the application, without the .desktop part. If allowed? is true, the application will have access to location information by default. The boolean system? value indicates whether an application is a system component or not. Finally users is a list of UIDs of all users for which this application is allowed location info access. An empty users list means that all users are allowed.

Scheme Variable: %standard-geoclue-applications

The standard list of well-known GeoClue application configurations, granting authority to the GNOME date-and-time utility to ask for the current location in order to set the time zone, and allowing the IceCat and Epiphany web browsers to request location information. IceCat and Epiphany both query the user before allowing a web page to know the user’s location.

Scheme Procedure: geoclue-service [#:colord colord] [#:whitelist '()] [#:wifi-geolocation-url "https://location.services.mozilla.com/v1/geolocate?key=geoclue"] [#:submit-data? #f]

[#:wifi-submission-url "https://location.services.mozilla.com/v1/submit?key=geoclue"]   [#:submission-nick "geoclue"]   [#:applications %standard-geoclue-applications] Return a service that runs the GeoClue location service. This service provides a D-Bus interface to allow applications to request access to a user’s physical location, and optionally to add information to online location databases. See the GeoClue web site for more information.

Scheme Procedure: bluetooth-service [#:bluez bluez] [#:auto-enable? #f]

Return a service that runs the bluetoothd daemon, which manages all the Bluetooth devices and provides a number of D-Bus interfaces. When AUTO-ENABLE? is true, the bluetooth controller is powered automatically at boot, which can be useful when using a bluetooth keyboard or mouse.

Users need to be in the lp group to access the D-Bus service.

Scheme Variable: gnome-keyring-service-type

This is the type of the service that adds the GNOME Keyring. Its value is a gnome-keyring-configuration object (see below).

This service adds the gnome-keyring package to the system profile and extends PAM with entries using pam_gnome_keyring.so, unlocking a user’s login keyring when they log in or setting its password with passwd.

Data Type: gnome-keyring-configuration

Configuration record for the GNOME Keyring service.

keyring (default: gnome-keyring)

The GNOME keyring package to use.

pam-services

A list of (service . kind) pairs denoting PAM services to extend, where service is the name of an existing service to extend and kind is one of login or passwd.

If login is given, it adds an optional pam_gnome_keyring.so to the auth block without arguments and to the session block with auto_start. If passwd is given, it adds an optional pam_gnome_keyring.so to the password block without arguments.

By default, this field contains “gdm-password” with the value login and “passwd” is with the value passwd.


Next: , Previous: , Up: Services   [Contents][Index]