summary refs log tree commit diff
path: root/gnu/services/desktop.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/services/desktop.scm')
-rw-r--r--gnu/services/desktop.scm29
1 files changed, 28 insertions, 1 deletions
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 1be05fda4e..9dcdf38be1 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
@@ -48,6 +48,7 @@
   #:use-module (gnu packages xfce)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages xdisorg)
+  #:use-module (gnu packages scanner)
   #:use-module (gnu packages suckless)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages libusb)
@@ -109,6 +110,7 @@
             accountsservice-service
 
             cups-pk-helper-service-type
+            sane-service-type
 
             gnome-desktop-configuration
             gnome-desktop-configuration?
@@ -837,6 +839,29 @@ accountsservice web site} for more information."
 
 
 ;;;
+;;; Scanner access via SANE.
+;;;
+
+(define %sane-accounts
+  ;; The '60-libsane.rules' udev rules refers to the "scanner" group.
+  (list (user-group (name "scanner") (system? #t))))
+
+(define sane-service-type
+  (service-type
+   (name 'sane)
+   (description
+    "This service provides access to scanners @i{via}
+@uref{http://www.sane-project.org, SANE} by installing the necessary udev
+rules.")
+   (default-value sane-backends-minimal)
+   (extensions
+    (list (service-extension udev-service-type list)
+          (service-extension account-service-type
+                             (const %sane-accounts))))))
+
+
+
+;;;
 ;;; GNOME desktop service.
 ;;;
 
@@ -1154,6 +1179,8 @@ or setting its password with passwd.")))
          ;; Add udev rules for MTP devices so that non-root users can access
          ;; them.
          (simple-service 'mtp udev-service-type (list libmtp))
+         ;; Add udev rules for scanners.
+         (service sane-service-type)
          ;; Add polkit rules, so that non-root users in the wheel group can
          ;; perform administrative tasks (similar to "sudo").
          polkit-wheel-service