diff options
author | Marius Bakke <mbakke@fastmail.com> | 2018-08-22 18:14:04 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2018-08-22 18:14:04 +0200 |
commit | 233df51ebc162bf95dfadf914914cbfbc6984651 (patch) | |
tree | 06fa8d78bbe97619450a88d8a38d01dc3775655b /gnu/services/security-token.scm | |
parent | 43cec3fb1ea54dedee8a5f613c833958c76892f4 (diff) | |
parent | 180a8986e57a6cfb65a8cddabcb430f23801832b (diff) | |
download | guix-patches-233df51ebc162bf95dfadf914914cbfbc6984651.tar guix-patches-233df51ebc162bf95dfadf914914cbfbc6984651.tar.gz |
Merge branch 'master' into staging
Diffstat (limited to 'gnu/services/security-token.scm')
-rw-r--r-- | gnu/services/security-token.scm | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/gnu/services/security-token.scm b/gnu/services/security-token.scm index 7e7ea54a50..354549b33c 100644 --- a/gnu/services/security-token.scm +++ b/gnu/services/security-token.scm @@ -20,6 +20,7 @@ #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (gnu packages admin) + #:use-module (gnu packages base) #:use-module (gnu packages security-token) #:use-module (gnu system shadow) #:use-module (guix gexp) @@ -62,14 +63,22 @@ (define pcscd-activation (match-lambda (($ <pcscd-configuration> pcsc-lite usb-drivers) - #~(begin - (use-modules (guix build utils)) - (mkdir-p "/var/lib") - (symlink #$(directory-union - "pcsc" - (map (cut file-append <> "/pcsc") - usb-drivers)) - "/var/lib/pcsc"))))) + (with-imported-modules (source-module-closure + '((guix build utils))) + #~(begin + (use-modules (guix build utils)) + ;; XXX: We can't use (guix utils) because it requires a + ;; dynamically-linked Guile, hence the duplicate switch-symlinks. + (define (switch-symlinks link target) + (let ((pivot (string-append link ".new"))) + (symlink target pivot) + (rename-file pivot link))) + (mkdir-p "/var/lib") + (switch-symlinks "/var/lib/pcsc" + #$(directory-union + "pcsc" + (map (cut file-append <> "/pcsc") + usb-drivers)))))))) (define pcscd-service-type (service-type |