aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-10-06 14:18:38 +0100
committerChristopher Baines <mail@cbaines.net>2019-10-06 14:18:38 +0100
commit7e5d54148d3d8734fec3c3d5a7e32a9a40dd1a2c (patch)
tree9ac2df425b7d99e4de81aa180f2392cae89e6bc4
parent7c199c14160699d9b1debcd042567fad13d51c22 (diff)
downloaddata-service-7e5d54148d3d8734fec3c3d5a7e32a9a40dd1a2c.tar
data-service-7e5d54148d3d8734fec3c3d5a7e32a9a40dd1a2c.tar.gz
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.
-rw-r--r--guix-data-service/config.scm.in9
1 files changed, 8 insertions, 1 deletions
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 @@
;;; <http://www.gnu.org/licenses/>.
(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)))