summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien 'neox' Bourmault <neox@gnu.org>2024-09-20 22:39:30 +0200
committerGuix Patches Tester <>2024-09-24 11:24:15 +0200
commitb0ecce2d17cfd261d872b29247f98687ed186c2f (patch)
treef6ef755ff20660f3ad3e89db8d27449b695ef762
parent8c32afd86ae598268aa753bd9753f80384a2c39f (diff)
downloadguix-patches-b0ecce2d17cfd261d872b29247f98687ed186c2f.tar
guix-patches-b0ecce2d17cfd261d872b29247f98687ed186c2f.tar.gz
services: sane-service-type: create lock path for plustek backendissue-73391
* gnu/services/desktop.scm (sane-service-type): extend with an activation service to create the lockpath and give the right permissions Change-Id: I187886d12b5f0b4fe21b03de178ea2187205387a Signed-off-by: Adrien 'neox' Bourmault <neox@gnu.org>
-rw-r--r--gnu/services/desktop.scm14
1 files changed, 14 insertions, 0 deletions
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 274aeeef9b..500527cb50 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021, 2022 muradm <mail@muradm.net>
;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2024 Adrien Bourmault <neox@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1408,6 +1409,17 @@ accountsservice web site} for more information."
;; The '60-libsane.rules' udev rules refers to the "scanner" group.
(list (user-group (name "scanner") (system? #t))))
+(define %sane-activation
+ #~(begin
+ (use-modules (guix build utils))
+ (let ((lockpath "/var/lock/sane")
+ (gid (vector-ref (getgrnam "scanner") 2)))
+ ;; Create the lock directory at runtime and give right perms
+ (mkdir-p lockpath)
+ (chown lockpath -1 gid)
+ (chmod lockpath #o770))
+ #t))
+
(define sane-service-type
(service-type
(name 'sane)
@@ -1418,6 +1430,8 @@ rules.")
(default-value sane-backends-minimal)
(extensions
(list (service-extension udev-service-type list)
+ (service-extension activation-service-type
+ (const %sane-activation))
(service-extension account-service-type
(const %sane-accounts))))))