diff --git a/modules/healthchecks.nix b/modules/healthchecks.nix new file mode 100644 index 0000000..9f88e1a --- /dev/null +++ b/modules/healthchecks.nix @@ -0,0 +1,47 @@ +{ ... }: +{ + # systemd.tmpfiles.rules = [ + # "f /run/agenix/freshrss 0770 freshrss freshrss -" + # ]; + + services = { + healthchecks = { + enable = false; + dataDir = "/var/lib/healthchecks"; + listenAddress = "localhost"; + port = 12121; + settings = { + DB = "sqlite"; + REGISTRATION_OPEN = false; + }; + }; + + nginx = { + virtualHosts = { + "healthchecks.bhankas.org" = { + addSSL = true; + enableACME = true; + locations = { + "/".extraConfig = '' + proxy_set_header Host $host; + ''; + + "~ ^.+?\.php(/.*)?$".extraConfig = '' + proxy_set_header Host $host; + ''; + }; + }; + }; + }; + }; + + security.acme = { + acceptTerms = true; + certs = { + "healthchecks.bhankas.org" = { + email = "admin@bhankas.org"; + dnsResolver = "1.1.1.1:53"; + }; + }; + }; +}