diff --git a/data.nix b/data.nix index f347609..7718762 100644 --- a/data.nix +++ b/data.nix @@ -33,10 +33,13 @@ rec { hass = 8123; prometheus = 9001; tailscale = 41641; - exporters.node = 9002; + exporters = { - # non-configurable in caddy as of 2023-09-06 - exporters.caddy = 2019; + node = 9002; + weather = 9011; + # non-configurable in caddy as of 2023-09-06 + caddy = 2019; + }; }; people_pubkeys = { diff --git a/hosts/fwminex/configuration.nix b/hosts/fwminex/configuration.nix index a521a9f..a142c19 100644 --- a/hosts/fwminex/configuration.nix +++ b/hosts/fwminex/configuration.nix @@ -84,6 +84,22 @@ in tmpfiles.rules = [ "d /var/www 0755 motiejus users -" ]; services = { + weather-exporter = { + description = "Weather exporter for Vilnius"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target.target" ]; + path = with pkgs; [ + coreutils + jq + curl + bash + ]; + serviceConfig = { + type = "notify"; + ExecStart = "${pkgs.systemd}/bin/systemd-socket-activate -a --inetd -l ${toString myData.ports.exporters.weather} ${../../pkgs/weather/main}"; + ProtectSystem = "strict"; + }; + }; caddy = let irc = config.mj.services.nsd-acme.zones."irc.jakstys.lt";