summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/deployment/photostore.krebsco.de.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-01-16 20:19:27 +0100
committertv <tv@krebsco.de>2018-01-16 20:19:27 +0100
commitcc4e5322aeca08d121b7769517136b05d7e391ca (patch)
tree8d8757d91cd631c58d30cb98589973a4983e9d4a /makefu/2configs/deployment/photostore.krebsco.de.nix
parent1c06f938b3d4e4e036184639ecdcadec27b5d8f8 (diff)
parent74d1531be988057ccadd3de5184d915dcf84c92d (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'makefu/2configs/deployment/photostore.krebsco.de.nix')
-rw-r--r--makefu/2configs/deployment/photostore.krebsco.de.nix40
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;
+ '';
+ };
+ };
+ };
+}