hosts/ni/services/monitoring: init

This commit is contained in:
Gabriel Arazas 2024-11-26 18:30:41 +08:00
parent 8618d3145e
commit 3e33e2b796
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 37 additions and 0 deletions

View File

@ -18,6 +18,7 @@
hardware.qol.enable = true;
networking.enable = true;
services.backup.enable = true;
services.monitoring.enable = true;
setups = {
desktop.enable = true;
development.enable = true;

View File

@ -5,6 +5,7 @@
./networking/setup.nix
./networking/wireguard.nix
./services/backup
./services/monitoring.nix
./services/download-media
./setups/desktop.nix
./setups/development.nix

View File

@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
let
hostCfg = config.hosts.ni;
cfg = hostCfg.services.monitoring;
in
{
options.hosts.ni.services.monitoring.enable =
lib.mkEnableOption "enable local desktop monitoring service";
config = lib.mkIf cfg.enable {
state.ports.grafana.value = 24532;
services.grafana.enable = true;
services.grafana.declarativePlugins = with pkgs.grafanaPlugins; [
grafana-piechart-panel
];
services.grafana.settings = {
database.type = "sqlite3";
server = {
http_address = "localhost";
http_port = config.state.ports.grafana.value;
};
# It's a local instance for a local use so there's not much to
# worry about.
security = {
admin_password = "admin";
admin_user = "admin";
};
};
};
}