From a3ea38d54592d615c8423d693e88a1af6fa61df4 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 26 Dec 2019 10:07:55 +0000 Subject: Serve the /nix-cache-info response This should be the last piece of the puzzle for providing substitutes for derivations. --- guix-data-service/web/nar/controller.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'guix-data-service/web/nar/controller.scm') diff --git a/guix-data-service/web/nar/controller.scm b/guix-data-service/web/nar/controller.scm index 783fd12..e7debea 100644 --- a/guix-data-service/web/nar/controller.scm +++ b/guix-data-service/web/nar/controller.scm @@ -45,6 +45,11 @@ (define %narinfo-signing-public-key (make-parameter #f)) +(define %nix-cache-info + `(("StoreDir" . "/gnu/store") + ("WantMassQuery" . 0) + ("Priority" . 100))) + (define (nar-controller request method-and-path-components mime-types @@ -54,6 +59,13 @@ (string-suffix? ".narinfo" s)) (match method-and-path-components + (('GET "nix-cache-info") + (render-text + (string-concatenate + (map (match-lambda + ((key . value) + (format #f "~a: ~a~%" key value))) + %nix-cache-info)))) (('GET "nar" derivation) (render-nar request mime-types -- cgit v1.2.3