From 18997b1fef5c92328188ab220be9464bf9653b8d Mon Sep 17 00:00:00 2001 From: lightly-toasted Date: Mon, 8 Dec 2025 19:26:02 +0900 Subject: [PATCH] feat(y2q): add prometheus --- home/modules/runit/services/prometheus.nix | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 home/modules/runit/services/prometheus.nix diff --git a/home/modules/runit/services/prometheus.nix b/home/modules/runit/services/prometheus.nix new file mode 100644 index 0000000..fbb5d2c --- /dev/null +++ b/home/modules/runit/services/prometheus.nix @@ -0,0 +1,25 @@ +{ pkgs, config, ... }: + +{ + home.file.".config/prometheus/prometheus.yml".text = '' + global: + scrape_interval: 1m + + scrape_configs: + - job_name: 'restic_rest_server' + static_configs: + - targets: ['${config.runit.services.restic-rest-server.environment.LISTEN_ADDR}'] + ''; + + runit.services.prometheus = { + script = '' + TSDB_PATH=$HOME/services/prometheus + mkdir -p TSDB_PATH + + exec ${pkgs.prometheus}/bin/prometheus \ + --config.file=$HOME/.config/prometheus/prometheus.yml \ + --storage.tsdb.path=$TSDB_PATH \ + --web.listen-address="127.0.0.1:9090" + ''; + }; +}