services: sane: Create the "scanner" account.

* gnu/services/desktop.scm (%sane-accounts, sane-service-type): New
variables.
(%desktop-services): Use SANE-SERVICE-TYPE instead of 'simple-service'.
* doc/guix.texi (Desktop Services): Document 'sane-service-type'.
This commit is contained in:
Ludovic Courtès 2020-01-21 14:26:41 +01:00
parent 5dc6d5ce99
commit b2f948be9f
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 33 additions and 2 deletions

View file

@ -15845,6 +15845,13 @@ this application is allowed location info access. An empty users list
means that all users are allowed. means that all users are allowed.
@end deffn @end deffn
@cindex scanner access
@deffn {Scheme Procedure} sane-service-type
This service provides access to scanners @i{via}
@uref{http://www.sane-project.org, SANE} by installing the necessary udev
rules.
@end deffn
@defvr {Scheme Variable} %standard-geoclue-applications @defvr {Scheme Variable} %standard-geoclue-applications
The standard list of well-known GeoClue application configurations, The standard list of well-known GeoClue application configurations,
granting authority to the GNOME date-and-time utility to ask for the granting authority to the GNOME date-and-time utility to ask for the

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; 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 Andy Wingo <wingo@igalia.com>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
@ -110,6 +110,7 @@ (define-module (gnu services desktop)
accountsservice-service accountsservice-service
cups-pk-helper-service-type cups-pk-helper-service-type
sane-service-type
gnome-desktop-configuration gnome-desktop-configuration
gnome-desktop-configuration? gnome-desktop-configuration?
@ -836,6 +837,29 @@ (define cups-pk-helper-service-type
(service-extension polkit-service-type list))) (service-extension polkit-service-type list)))
(default-value cups-pk-helper))) (default-value cups-pk-helper)))
;;;
;;; 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. ;;; GNOME desktop service.
@ -1156,7 +1180,7 @@ (define %desktop-services
;; them. ;; them.
(simple-service 'mtp udev-service-type (list libmtp)) (simple-service 'mtp udev-service-type (list libmtp))
;; Add udev rules for scanners. ;; Add udev rules for scanners.
(simple-service 'sane udev-service-type (list sane-backends-minimal)) (service sane-service-type)
;; Add polkit rules, so that non-root users in the wheel group can ;; Add polkit rules, so that non-root users in the wheel group can
;; perform administrative tasks (similar to "sudo"). ;; perform administrative tasks (similar to "sudo").
polkit-wheel-service polkit-wheel-service