summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/deployment/gecloudpad/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-03-13 10:42:39 +0100
committermakefu <github@syntax-fehler.de>2020-03-13 10:42:39 +0100
commit3e27de38fc3e9043187cd65986a799af3b356967 (patch)
tree91aadba2fd8292ab3bb8ff42efd57cbdcf82b0d7 /makefu/2configs/deployment/gecloudpad/default.nix
parentf88e30e5ad906d946852891b6d668d8910c943b2 (diff)
ma deployment: add board.euer, rss.euer
Diffstat (limited to 'makefu/2configs/deployment/gecloudpad/default.nix')
-rw-r--r--makefu/2configs/deployment/gecloudpad/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/gecloudpad/default.nix b/makefu/2configs/deployment/gecloudpad/default.nix
new file mode 100644
index 000000000..e13ec6ae6
--- /dev/null
+++ b/makefu/2configs/deployment/gecloudpad/default.nix
@@ -0,0 +1,43 @@
+{ config, lib, pkgs, ... }:
+# more than just nginx config but not enough to become a module
+let
+ wsgi-sock = "${workdir}/uwsgi-gecloudpad.sock";
+ workdir = config.services.uwsgi.runDir;
+ gecloudpad = pkgs.python3Packages.callPackage ./gecloudpad.nix {};
+in {
+
+ services.uwsgi = {
+ enable = true;
+ user = "nginx";
+ # runDir = "/var/lib/photostore";
+ plugins = [ "python3" ];
+ instance = {
+ type = "emperor";
+ vassals = {
+ gecloudpad = {
+ type = "normal";
+ pythonPackages = self: with self; [ gecloudpad ];
+ socket = wsgi-sock;
+ };
+ };
+ };
+ };
+
+ services.nginx = {
+ enable = lib.mkDefault true;
+ virtualHosts."pad.binaergewitter.de" = {
+ enableACME = true;
+ forceSSL = true;
+ locations = {
+ "/".extraConfig = ''
+ expires -1;
+ uwsgi_pass unix://${wsgi-sock};
+ uwsgi_param UWSGI_CHDIR ${gecloudpad}/${pkgs.python.sitePackages};
+ uwsgi_param UWSGI_MODULE gecloudpad.main;
+ uwsgi_param UWSGI_CALLABLE app;
+ include ${pkgs.nginx}/conf/uwsgi_params;
+ '';
+ };
+ };
+ };
+}