1 { config, pkgs, lib, name, ... }:
5 enable = lib.mkOption {
9 Whether to enable status app.
14 config = lib.mkIf config.myServices.status.enable {
17 dest = "naemon-status/environment";
22 TOKENS=${builtins.concatStringsSep " " config.myEnv.monitoring.nrdp_tokens}
28 recommendedOptimisation = true;
29 recommendedGzipSettings = true;
30 recommendedProxySettings = true;
31 virtualHosts."status.immae.eu" = {
34 locations."/".proxyPass = "http://unix:/run/naemon-status/socket.sock:/";
37 security.acme2.certs."${name}".extraDomains."status.immae.eu" = null;
39 myServices.certificates.enable = true;
40 networking.firewall.allowedTCPPorts = [ 80 443 ];
41 systemd.services.naemon-status = {
42 description = "Naemon status";
43 after = [ "network.target" ];
44 wantedBy = [ "multi-user.target" ];
47 EnvironmentFile = config.secrets.fullPaths."naemon-status/environment";
49 WorkingDirectory = "${./status}";
51 python = pkgs.python3.withPackages (p: [ p.gunicorn p.flask p.flask_login ]);
53 "${python}/bin/gunicorn -w4 --bind unix:/run/naemon-status/socket.sock app:app";
55 RuntimeDirectory = "naemon-status";
56 StandardOutput = "journal";
57 StandardError = "inherit";