From 6f8f7239dc276479d691dcd0ffb5124bd62032ad Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 18 Sep 2025 08:52:11 +0200 Subject: feat(ev): add miniflux I already had a miniflux instance a couple years ago but accidentally dropped the database. --- nixos/hosts/ev/exporters.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 nixos/hosts/ev/exporters.nix (limited to 'nixos/hosts/ev/exporters.nix') diff --git a/nixos/hosts/ev/exporters.nix b/nixos/hosts/ev/exporters.nix new file mode 100644 index 0000000..1c03c35 --- /dev/null +++ b/nixos/hosts/ev/exporters.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: + +let + helpers = import { inherit config lib pkgs; }; + cfg = config.exporters; +in +{ + options.exporters = { + sqlExporterPort = lib.mkOption { + type = lib.types.int; + }; + }; + + imports = [ + + ]; + + config = { + services.prometheus-sql-exporter = { + enable = true; + port = cfg.sqlExporterPort; + config = { + target = { + # This URL should be postgresql:///postgres?host=/run/postgresql + # but sql_exporter uses xo/dburl which isn't spec-compliant: https://github.com/xo/dburl/issues/46 + data_source_name = "postgresql:/run/postgresql:/postgres"; + collectors = helpers.collectorNames; + }; + collectors = helpers.collectors; + }; + }; + + monitoring.prometheusScrapeConfigs = [ + { + job_name = "sql"; + static_configs = [{ + targets = [ "localhost:${toString cfg.sqlExporterPort}" ]; + }]; + } + ]; + }; +} -- cgit v1.2.3