diff options
author | tv <tv@krebsco.de> | 2016-02-19 14:30:39 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-02-19 14:30:39 +0100 |
commit | cb258d399015cf8fe1439b21e6b1208d72101adc (patch) | |
tree | ef17d417419e5bb00487ec98e4c36e80485ede97 /makefu/2configs/deployment/mycube.connector.one.nix | |
parent | ffc47bf80d521635021b3f7a0122092708ebd2bf (diff) | |
parent | 74cfe87654638106f2d2a1a698814b41c2e904f2 (diff) |
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/deployment/mycube.connector.one.nix')
-rw-r--r-- | makefu/2configs/deployment/mycube.connector.one.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/mycube.connector.one.nix b/makefu/2configs/deployment/mycube.connector.one.nix new file mode 100644 index 000000000..38fc4a243 --- /dev/null +++ b/makefu/2configs/deployment/mycube.connector.one.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, ... }: +# more than just nginx config but not enough to become a module +with config.krebs.lib; +let + hostname = config.krebs.build.host.name; + external-ip = head config.krebs.build.host.nets.internet.addrs4; + wsgi-sock = "${config.services.uwsgi.runDir}/uwsgi.sock"; +in { + services.redis.enable = true; + services.uwsgi = { + enable = true; + user = "nginx"; + plugins = [ "python2" ]; + instance = { + type = "emperor"; + vassals = { + mycube-flask = { + type = "normal"; + python2Packages = self: with self; [ pkgs.mycube-flask flask redis werkzeug jinja2 markupsafe itsdangerous ]; + socket = wsgi-sock; + }; + }; + }; + }; + + krebs.nginx = { + enable = mkDefault true; + servers = { + mybox-connector-one = { + listen = [ "${external-ip}:80" ]; + server-names = [ + "mycube.connector.one" + "mybox.connector.one" + ]; + locations = singleton (nameValuePair "/" '' + uwsgi_pass unix://${wsgi-sock}; + uwsgi_param UWSGI_CHDIR ${pkgs.mycube-flask}/${pkgs.python.sitePackages}; + uwsgi_param UWSGI_MODULE mycube.websrv; + uwsgi_param UWSGI_CALLABLE app; + + include ${pkgs.nginx}/conf/uwsgi_params; + ''); + }; + }; + }; +} |