From cc51c5f7db21749b87b0db096087b7e7447a8f0a Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 10 Jan 2018 00:04:07 +0100 Subject: ma photostore.krebsco.de: init on gum.r also init the application server and config --- .../2configs/deployment/photostore.krebsco.de.nix | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 makefu/2configs/deployment/photostore.krebsco.de.nix (limited to 'makefu/2configs/deployment/photostore.krebsco.de.nix') diff --git a/makefu/2configs/deployment/photostore.krebsco.de.nix b/makefu/2configs/deployment/photostore.krebsco.de.nix new file mode 100644 index 00000000..9e16a384 --- /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 ; +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; + ''; + }; + }; + }; +} -- cgit v1.2.3