From b2f948be9f815582a49bd80a9594a881d7d1a56e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 21 Jan 2020 14:26:41 +0100 Subject: 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'. --- gnu/services/desktop.scm | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index dec1c3fa0f..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 +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2015 Andy Wingo ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2016 Sou Bunnbu @@ -110,6 +110,7 @@ accountsservice-service cups-pk-helper-service-type + sane-service-type gnome-desktop-configuration gnome-desktop-configuration? @@ -836,6 +837,29 @@ accountsservice web site} for more information." (service-extension polkit-service-type list))) (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. @@ -1156,7 +1180,7 @@ or setting its password with passwd."))) ;; them. (simple-service 'mtp udev-service-type (list libmtp)) ;; 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 ;; perform administrative tasks (similar to "sudo"). polkit-wheel-service -- cgit v1.2.3