diff options
-rw-r--r-- | guix-web/package.scm | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/guix-web/package.scm b/guix-web/package.scm index 845eba7..ae7c152 100644 --- a/guix-web/package.scm +++ b/guix-web/package.scm @@ -28,7 +28,6 @@ #:use-module (gnu packages) #:export (package-install)) -(define %store (open-connection)) (define %profile (string-append "/usr/var/guix/profiles/per-user/" (getenv "USER") "/guix-profile")) @@ -40,16 +39,17 @@ (add-indirect-root store (canonicalize-path profile)))) (define (package-install package) - (let* ((new (manifest-add manifest - (list (package->manifest-entry package)))) - (prof-drv (run-with-store %store - (profile-derivation new))) - (prof (derivation->output-path prof-drv))) - (let* ((number (generation-number %profile)) - (name (generation-file-name %profile - (+ 1 number)))) - (and (build-derivations %store (list prof-drv)) - (let* ((entries (manifest-entries new)) - (count (length entries))) - (switch-symlinks name prof) - (switch-symlinks %profile name)))))) + (with-store %store + (let* ((new (manifest-add manifest + (list (package->manifest-entry package)))) + (prof-drv (run-with-store %store + (profile-derivation new))) + (prof (derivation->output-path prof-drv))) + (let* ((number (generation-number %profile)) + (name (generation-file-name %profile + (+ 1 number)))) + (and (build-derivations %store (list prof-drv)) + (let* ((entries (manifest-entries new)) + (count (length entries))) + (switch-symlinks name prof) + (switch-symlinks %profile name))))))) |