diff options
Diffstat (limited to 'genenetwork/services/genenetwork.scm')
-rw-r--r-- | genenetwork/services/genenetwork.scm | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/genenetwork/services/genenetwork.scm b/genenetwork/services/genenetwork.scm index b13d006..c25caf0 100644 --- a/genenetwork/services/genenetwork.scm +++ b/genenetwork/services/genenetwork.scm @@ -21,7 +21,9 @@ (define-module (genenetwork services genenetwork) #:use-module ((gn packages genenetwork) #:select (genenetwork2 genenetwork3 gn-auth gn-uploader)) + #:use-module ((gnu packages web) #:select (nginx)) #:use-module ((gnu packages admin) #:select (shadow)) + #:use-module ((gnu packages python) #:select (python-3)) #:use-module (gnu services) #:use-module (gnu services web) #:use-module (gnu system file-systems) @@ -29,6 +31,10 @@ #:use-module (guix gexp) #:use-module (guix profiles) #:use-module (guix records) + #:use-module (guix store) + #:use-module (guix derivations) + #:use-module (guix packages) + #:use-module (guix build python-build-system) #:use-module (forge environment) #:use-module (forge nginx) #:use-module (forge gunicorn) @@ -449,13 +455,33 @@ a @code{<genenetwork-configuration>} record." (writable? #t)))) (extra-cli-arguments (list "--log-level" log-level))))))) +(define (package-output-path package) + "Return the computed store output path for `PACKAGE'." + (derivation-output-path + (assoc-ref + (derivation-outputs + (with-store %store + (run-with-store %store + (lower-object package)))) "out"))) + (define (gn-uploader-nginx-server-block config) (match-record config <gn-uploader-configuration> - (server-name port) + (server-name port gn-uploader) (list (nginx-server-configuration (server-name (list server-name)) (locations (list (nginx-location-configuration + (uri "/static") + (body + (list + #~(string-append "include " + #$(file-append nginx "/share/nginx/conf/mime.types;")) + #~(string-append "root " + #$(file-append gn-uploader + "/lib/python" + (python-version (package-version python-3)) + "/site-packages/qc_app;"))))) + (nginx-location-configuration (uri "/") (body (list (string-append "proxy_pass http://localhost:" (number->string port) ";") |