From 3b8a40fe952fba72fa0377936d74015fcf1c2486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Fri, 13 Sep 2024 16:29:02 +0300 Subject: [PATCH] +weather --- data.nix | 9 ++++++--- hosts/fwminex/configuration.nix | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) 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";