mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 03:49:44 +00:00
25 lines
639 B
Nix
25 lines
639 B
Nix
{ 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"
|
|
'';
|
|
};
|
|
}
|