diff options
author | nin <nin@c-base.org> | 2018-01-11 23:03:10 +0100 |
---|---|---|
committer | nin <nin@c-base.org> | 2018-01-11 23:03:10 +0100 |
commit | 80c2e23ec028bfda5c0bad0e3269648d34d298b0 (patch) | |
tree | 0b1a0b2312ee8afc874639b5d2ee52fc410403fe /makefu/2configs/deployment | |
parent | 64b06a2a0c09f5e57f65bcbf1494c856b58666c3 (diff) | |
parent | 279ce3bbbc562d53ba4696c90025671be32b5e0e (diff) |
Merge branch 'master' of prism:stockholm
Diffstat (limited to 'makefu/2configs/deployment')
-rw-r--r-- | makefu/2configs/deployment/photostore.krebsco.de.nix | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/photostore.krebsco.de.nix b/makefu/2configs/deployment/photostore.krebsco.de.nix new file mode 100644 index 000000000..9e16a384a --- /dev/null +++ b/makefu/2configs/deployment/photostore.krebsco.de.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: +# more than just nginx config but not enough to become a module +with import <stockholm/lib>; +let + wsgi-sock = "${workdir}/uwsgi-photostore.sock"; + workdir = config.services.uwsgi.runDir; +in { + + services.uwsgi = { + enable = true; + user = "nginx"; + runDir = "/var/lib/photostore"; + plugins = [ "python3" ]; + instance = { + type = "emperor"; + vassals = { + cameraupload-server = { + type = "normal"; + pythonPackages = self: with self; [ pkgs.cameraupload-server ]; + socket = wsgi-sock; + }; + }; + }; + }; + + services.nginx = { + enable = mkDefault true; + virtualHosts."photostore.krebsco.de" = { + locations = { + "/".extraConfig = '' + uwsgi_pass unix://${wsgi-sock}; + uwsgi_param UWSGI_CHDIR ${workdir}; + uwsgi_param UWSGI_MODULE cuserver.main; + uwsgi_param UWSGI_CALLABLE app; + include ${pkgs.nginx}/conf/uwsgi_params; + ''; + }; + }; + }; +} |