From 7e5d54148d3d8734fec3c3d5a7e32a9a40dd1a2c Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 6 Oct 2019 14:18:38 +0100 Subject: [PATCH] Add assets-dir-in-store? to the config module To allow looking up if the assets are in the store, which will happen if the Guix Data Service is running from a Guix package. --- guix-data-service/config.scm.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/guix-data-service/config.scm.in b/guix-data-service/config.scm.in index ab34254..6532641 100644 --- a/guix-data-service/config.scm.in +++ b/guix-data-service/config.scm.in @@ -17,7 +17,10 @@ ;;; . (define-module (guix-data-service config) - #:export (%config)) + #:use-module (guix store) + #:export (%config + + assets-dir-in-store?)) (define %config (let ((config @@ -57,3 +60,7 @@ (database-name . "guix_data_service")))) (lambda (key) (assoc-ref config key)))) + +(define assets-dir-in-store? + (string-prefix? (%store-prefix) + (%config 'assets-dir)))