mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 07:59:43 +00:00
Compare commits
3 commits
10516f783a
...
bb37a6c3a8
| Author | SHA1 | Date | |
|---|---|---|---|
| bb37a6c3a8 | |||
| 18997b1fef | |||
| c10916f47a |
4 changed files with 55 additions and 3 deletions
|
|
@ -19,6 +19,11 @@
|
||||||
# Glances
|
# Glances
|
||||||
reverse_proxy http://localhost:61208
|
reverse_proxy http://localhost:61208
|
||||||
}
|
}
|
||||||
|
|
||||||
|
http://grafana.ts.toast.name {
|
||||||
|
# Grafana
|
||||||
|
reverse_proxy http://localhost:${config.runit.services.grafana.environment.GF_SERVER_HTTP_PORT}
|
||||||
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
runit.services.caddy = {
|
runit.services.caddy = {
|
||||||
|
|
|
||||||
21
home/modules/runit/services/grafana.nix
Normal file
21
home/modules/runit/services/grafana.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ pkgs, config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
runit.services.grafana = {
|
||||||
|
script = ''
|
||||||
|
HOME_PATH=$HOME/services/grafana
|
||||||
|
mkdir -p "$HOME_PATH"
|
||||||
|
|
||||||
|
exec ${pkgs.grafana}/bin/grafana server \
|
||||||
|
--homepath ${pkgs.grafana}/share/grafana
|
||||||
|
'';
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
GF_SERVER_HTTP_ADDR = "127.0.0.1";
|
||||||
|
GF_SERVER_HTTP_PORT = "3000";
|
||||||
|
GF_PATHS_DATA = "${config.home.homeDirectory}/services/grafana";
|
||||||
|
};
|
||||||
|
|
||||||
|
log.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
25
home/modules/runit/services/prometheus.nix
Normal file
25
home/modules/runit/services/prometheus.nix
Normal file
|
|
@ -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"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"restic/env" = {};
|
"restic/env" = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.restic.backups.b2 = {
|
services.restic.backups.y2q = {
|
||||||
initialize = true;
|
initialize = true;
|
||||||
inhibitsSleep = true;
|
inhibitsSleep = true;
|
||||||
passwordFile = config.sops.secrets."restic/password".path;
|
passwordFile = config.sops.secrets."restic/password".path;
|
||||||
|
|
@ -15,15 +15,16 @@
|
||||||
"/home/toast/workspace"
|
"/home/toast/workspace"
|
||||||
];
|
];
|
||||||
exclude = [ "node_modules" ];
|
exclude = [ "node_modules" ];
|
||||||
repository = "s3:https://s3.us-east-005.backblazeb2.com/restic-backups-0";
|
repository = "rest:http://y2q:9000/nixos/";
|
||||||
environmentFile = config.sops.secrets."restic/env".path;
|
environmentFile = config.sops.secrets."restic/env".path;
|
||||||
pruneOpts = [
|
pruneOpts = [
|
||||||
|
"--keep-hourly 6"
|
||||||
"--keep-daily 7"
|
"--keep-daily 7"
|
||||||
"--keep-weekly 3"
|
"--keep-weekly 3"
|
||||||
"--keep-monthly 3"
|
"--keep-monthly 3"
|
||||||
];
|
];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar = "daily";
|
OnCalendar = "hourly";
|
||||||
Persistent = true;
|
Persistent = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue