aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/desktop.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/services/desktop.scm')
-rw-r--r--gnu/services/desktop.scm109
1 files changed, 79 insertions, 30 deletions
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index fbeabf1162..ce63969dc8 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -39,6 +40,7 @@
#:use-module (gnu system pam)
#:use-module (gnu packages glib)
#:use-module (gnu packages admin)
+ #:use-module (gnu packages cups)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages gnome)
#:use-module (gnu packages xfce)
@@ -49,6 +51,7 @@
#:use-module (gnu packages libusb)
#:use-module (gnu packages mate)
#:use-module (gnu packages enlightenment)
+ #:use-module (guix deprecation)
#:use-module (guix records)
#:use-module (guix packages)
#:use-module (guix store)
@@ -56,8 +59,22 @@
#:use-module (guix gexp)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
- #:export (upower-configuration
+ #:export (<upower-configuration>
+ upower-configuration
upower-configuration?
+ upower-configuration-upower
+ upower-configuration-watts-up-pro?
+ upower-configuration-poll-batteries?
+ upower-configuration-ignore-lid?
+ upower-configuration-use-percentage-for-policy?
+ upower-configuration-percentage-low
+ upower-configuration-percentage-critical
+ upower-configuration-percentage-action
+ upower-configuration-time-low
+ upower-configuration-time-critical
+ upower-configuration-time-action
+ upower-configuration-critical-power-action
+
upower-service
upower-service-type
@@ -173,23 +190,33 @@ is set to @var{value} when the bus daemon launches it."
;;; Upower D-Bus service.
;;;
-;; TODO: Export.
(define-record-type* <upower-configuration>
upower-configuration make-upower-configuration
upower-configuration?
- (upower upower-configuration-upower
- (default upower))
- (watts-up-pro? upower-configuration-watts-up-pro?)
- (poll-batteries? upower-configuration-poll-batteries?)
- (ignore-lid? upower-configuration-ignore-lid?)
- (use-percentage-for-policy? upower-configuration-use-percentage-for-policy?)
- (percentage-low upower-configuration-percentage-low)
- (percentage-critical upower-configuration-percentage-critical)
- (percentage-action upower-configuration-percentage-action)
- (time-low upower-configuration-time-low)
- (time-critical upower-configuration-time-critical)
- (time-action upower-configuration-time-action)
- (critical-power-action upower-configuration-critical-power-action))
+ (upower upower-configuration-upower
+ (default upower))
+ (watts-up-pro? upower-configuration-watts-up-pro?
+ (default #f))
+ (poll-batteries? upower-configuration-poll-batteries?
+ (default #t))
+ (ignore-lid? upower-configuration-ignore-lid?
+ (default #f))
+ (use-percentage-for-policy? upower-configuration-use-percentage-for-policy?
+ (default #f))
+ (percentage-low upower-configuration-percentage-low
+ (default 10))
+ (percentage-critical upower-configuration-percentage-critical
+ (default 3))
+ (percentage-action upower-configuration-percentage-action
+ (default 2))
+ (time-low upower-configuration-time-low
+ (default 1200))
+ (time-critical upower-configuration-time-critical
+ (default 300))
+ (time-action upower-configuration-time-action
+ (default 120))
+ (critical-power-action upower-configuration-critical-power-action
+ (default 'hybrid-sleep)))
(define* upower-configuration-file
;; Return an upower-daemon configuration file.
@@ -247,6 +274,11 @@ is set to @var{value} when the bus daemon launches it."
(define upower-service-type
(let ((upower-package (compose list upower-configuration-upower)))
(service-type (name 'upower)
+ (description
+ "Run @command{upowerd}}, a system-wide monitor for power
+consumption and battery levels, with the given configuration settings. It
+implements the @code{org.freedesktop.UPower} D-Bus interface, and is notably
+used by GNOME.")
(extensions
(list (service-extension dbus-root-service-type
upower-dbus-service)
@@ -259,20 +291,21 @@ is set to @var{value} when the bus daemon launches it."
;; Make the 'upower' command visible.
(service-extension profile-service-type
- upower-package))))))
-
-(define* (upower-service #:key (upower upower)
- (watts-up-pro? #f)
- (poll-batteries? #t)
- (ignore-lid? #f)
- (use-percentage-for-policy? #f)
- (percentage-low 10)
- (percentage-critical 3)
- (percentage-action 2)
- (time-low 1200)
- (time-critical 300)
- (time-action 120)
- (critical-power-action 'hybrid-sleep))
+ upower-package)))
+ (default-value (upower-configuration)))))
+
+(define-deprecated (upower-service #:key (upower upower)
+ (watts-up-pro? #f)
+ (poll-batteries? #t)
+ (ignore-lid? #f)
+ (use-percentage-for-policy? #f)
+ (percentage-low 10)
+ (percentage-critical 3)
+ (percentage-action 2)
+ (time-low 1200)
+ (time-critical 300)
+ (time-action 120)
+ (critical-power-action 'hybrid-sleep))
"Return a service that runs @uref{http://upower.freedesktop.org/,
@command{upowerd}}, a system-wide monitor for power consumption and battery
levels, with the given configuration settings. It implements the
@@ -802,6 +835,21 @@ accountsservice web site} for more information."
;;;
+;;; cups-pk-helper service.
+;;;
+
+(define cups-pk-helper-service-type
+ (service-type
+ (name 'cups-pk-helper)
+ (description
+ "PolicyKit helper to configure CUPS with fine-grained privileges.")
+ (extensions
+ (list (service-extension dbus-root-service-type list)
+ (service-extension polkit-service-type list)))
+ (default-value cups-pk-helper)))
+
+
+;;;
;;; GNOME desktop service.
;;;
@@ -988,8 +1036,9 @@ as expected.")))
(service wpa-supplicant-service-type) ;needed by NetworkManager
(service avahi-service-type)
(udisks-service)
- (upower-service)
+ (service upower-service-type)
(accountsservice-service)
+ (service cups-pk-helper-service-type)
(colord-service)
(geoclue-service)
(service polkit-service-type)