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.
This commit is contained in:
Christopher Baines 2019-10-06 14:18:38 +01:00
parent 7c199c1416
commit 7e5d54148d

View file

@ -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)))