Initial commit

This commit is contained in:
Tove 2025-12-29 04:02:22 +01:00
commit 72c9053f0d
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
7 changed files with 38 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use nix

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/run/
.direnv/

12
init.sh Normal file
View file

@ -0,0 +1,12 @@
#/bin/sh
mkdir run && cp -r $GRAFANA_PATH/share/grafana/* run/
mkdir run/prometheus
cp prometheus.yml run/prometheus
cd run
nix-build "<nixpkgs>" -A grafana -o grafana
nix-build "<nixpkgs>" -A prometheus -o prometheus/prometheus
echo -n "enter new admin password: "
read passwd
./grafana/bin/grafana cli admin reset-admin-password "$passwd"

8
prometheus.yml Normal file
View file

@ -0,0 +1,8 @@
scrape_configs:
- job_name: bombai_git.tudbut.de
metrics_path: /bombai/metrics
scrape_interval: 1s
scheme: https
static_configs:
- targets:
- git.tudbut.de

3
run_grafana.sh Normal file
View file

@ -0,0 +1,3 @@
#/bin/sh
cd run
./grafana/bin/grafana server

3
run_prometheus.sh Normal file
View file

@ -0,0 +1,3 @@
#/bin/sh
cd run/prometheus
./prometheus/bin/prometheus --web.listen-address=[::1]:9090

9
shell.nix Normal file
View file

@ -0,0 +1,9 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
grafana
prometheus
];
GRAFANA_PATH = "${pkgs.grafana}";
PROMETHEUS_PATH = "${pkgs.prometheus}";
}