1 { lib, config, pkgs, ... }:
3 cfg = config.myServices.websites.denise.oms;
4 varDir = "/var/lib/buildbot/outputs/denise_oms";
5 socket = "/run/denise_oms/socket.sock";
7 options.myServices.websites.denise.oms.enable = lib.mkEnableOption "enable Denise's OMS website";
9 config = lib.mkIf cfg.enable {
10 services.websites.env.production.vhostConfs.denise_oms = {
13 hosts = [ "oms.syanni.eu" ];
20 ProxyPassMatch ^/.well-known/acme-challenge !
21 ProxyPass / unix://${socket}|http://oms.syanni.eu/
22 ProxyPassReverse / unix://${socket}|http://oms.syanni.eu/
27 systemd.services.denise-oms = {
28 description = "Denise OMS website";
29 after = [ "network.target" ];
30 wantedBy = [ "multi-user.target" ];
34 WorkingDirectory = varDir;
36 python = pkgs.python3.withPackages (p: [ p.gunicorn p.flask p.matplotlib ]);
38 "${python}/bin/gunicorn -w4 -p /run/denise_oms/gunicorn.pid --bind unix:${socket} app:app";
42 PIDFile = "/run/denise_oms/gunicorn.pid";
43 RuntimeDirectory = "denise_oms";
44 StandardOutput = "journal";
45 StandardError = "inherit";