mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Add dash
This commit is contained in:
parent
87fe0471ad
commit
41567c9aa3
4 changed files with 57 additions and 0 deletions
|
|
@ -41,6 +41,7 @@ in {
|
||||||
mods.server.git.enable = true;
|
mods.server.git.enable = true;
|
||||||
mods.server.cal.enable = true;
|
mods.server.cal.enable = true;
|
||||||
mods.server.chat.enable = true;
|
mods.server.chat.enable = true;
|
||||||
|
mods.server.dash.enable = true;
|
||||||
|
|
||||||
mods.server.vrising.enable = true;
|
mods.server.vrising.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
git = 3006;
|
git = 3006;
|
||||||
cal = 3007;
|
cal = 3007;
|
||||||
chat = 3008;
|
chat = 3008;
|
||||||
|
dash = 3009;
|
||||||
|
|
||||||
search = 8081;
|
search = 8081;
|
||||||
videos = 8082;
|
videos = 8082;
|
||||||
|
|
|
||||||
54
modules/nixos/server/dash.nix
Normal file
54
modules/nixos/server/dash.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.mods.server;
|
||||||
|
port = cfg.nginx.ports.dash;
|
||||||
|
in with lib; {
|
||||||
|
options.mods.server = {
|
||||||
|
dash = {
|
||||||
|
enable = mkEnableOption {
|
||||||
|
default = false;
|
||||||
|
description = "enables metrics dashboard";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.dash.enable {
|
||||||
|
services.grafana = {
|
||||||
|
enable = true;
|
||||||
|
domain = "dash.muon.host";
|
||||||
|
addr = "0.0.0.0";
|
||||||
|
|
||||||
|
provision.datasources.settings.datasources = [{
|
||||||
|
name = "Prometheus";
|
||||||
|
type = "Prometheus";
|
||||||
|
url = "http://localhost:${toString config.services.prometheus.port}";
|
||||||
|
}];
|
||||||
|
|
||||||
|
inherit port;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
port = 9001;
|
||||||
|
|
||||||
|
exporters = {
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
enabledCollectors = [ "systemd" ];
|
||||||
|
port = 9002;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
scrapeConfigs = [{
|
||||||
|
job_name = "muho";
|
||||||
|
static_configs = [{
|
||||||
|
targets = [
|
||||||
|
"127.0.0.1:${
|
||||||
|
toString config.services.prometheus.exporters.node.port
|
||||||
|
}"
|
||||||
|
];
|
||||||
|
}];
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -19,5 +19,6 @@
|
||||||
./git.nix
|
./git.nix
|
||||||
./cal.nix
|
./cal.nix
|
||||||
./chat.nix
|
./chat.nix
|
||||||
|
./dash.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue