1 { lib, config, pkgs, ... }:
3 cfg = config.myServices.websites.denise.oms;
4 varDir = "/var/lib/buildbot/outputs/denise/oms";
5 varDirBeta = "/var/lib/buildbot/outputs/denise/oms_beta";
6 socket = "/run/denise_oms/socket.sock";
7 socket_beta = "/run/denise_oms_beta/socket.sock";
9 options.myServices.websites.denise.oms.enable = lib.mkEnableOption "enable Denise's OMS website";
11 config = lib.mkIf cfg.enable {
12 services.websites.env.production.vhostConfs.denise_oms = {
15 hosts = [ "oms.syanni.eu" ];
22 ProxyPassMatch ^/.well-known/acme-challenge !
23 ProxyPass / unix://${socket}|http://oms.syanni.eu/
24 ProxyPassReverse / unix://${socket}|http://oms.syanni.eu/
29 systemd.services.denise-oms = {
30 description = "Denise OMS website";
31 after = [ "network.target" ];
32 wantedBy = [ "multi-user.target" ];
36 WorkingDirectory = varDir;
38 python = pkgs.python39.withPackages (p: [ p.gunicorn p.flask p.matplotlib p.unidecode ]);
40 "${python}/bin/gunicorn -w4 -p /run/denise_oms/gunicorn.pid --bind unix:${socket} app:app";
44 PIDFile = "/run/denise_oms/gunicorn.pid";
45 RuntimeDirectory = "denise_oms";
46 StandardOutput = "journal";
47 StandardError = "inherit";
51 security.sudo.extraRules = [
54 { options = [ "NOPASSWD" ]; command = "${pkgs.systemd}/bin/systemctl restart denise-oms-beta.service"; }
55 { options = [ "NOPASSWD" ]; command = "${pkgs.systemd}/bin/systemctl restart denise-oms.service"; }
61 services.websites.env.integration.vhostConfs.denise_oms_beta = {
62 certName = "integration";
64 hosts = [ "beta.oms.syanni.eu" ];
71 ProxyPassMatch ^/.well-known/acme-challenge !
72 ProxyPass / unix://${socket_beta}|http://beta.oms.syanni.eu/
73 ProxyPassReverse / unix://${socket_beta}|http://beta.oms.syanni.eu/
78 systemd.services.denise-oms-beta = {
79 description = "Denise OMS beta website";
80 after = [ "network.target" ];
81 wantedBy = [ "multi-user.target" ];
85 WorkingDirectory = varDirBeta;
87 python = pkgs.python39.withPackages (p: [ p.gunicorn p.flask p.matplotlib p.unidecode ]);
89 "${python}/bin/gunicorn -w4 -p /run/denise_oms_beta/gunicorn.pid --bind unix:${socket_beta} app:app";
93 PIDFile = "/run/denise_oms_beta/gunicorn.pid";
94 RuntimeDirectory = "denise_oms_beta";
95 StandardOutput = "journal";
96 StandardError = "inherit";