@@ -1408,6 +1408,17 @@ (define %sane-accounts
;; 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 +1429,8 @@ (define sane-service-type
(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))))))