feat(core): initialize NaxOS declarative NixOS distribution, modules, and ISO installer
Test NaxOS Module Configurations / test-modules (push) Failing after 6m10s
Test NaxOS Module Configurations / test-modules (push) Failing after 6m10s
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.naxos.monitoring;
|
||||
in {
|
||||
options.services.naxos.monitoring = {
|
||||
enable = mkEnableOption "NaxOS Metrics and Telemetry Collection";
|
||||
|
||||
prometheusPort = mkOption {
|
||||
type = types.port;
|
||||
default = 9090;
|
||||
description = "Prometheus server listen port.";
|
||||
};
|
||||
|
||||
nodeExporterPort = mkOption {
|
||||
type = types.port;
|
||||
default = 9100;
|
||||
description = "Node exporter listen port.";
|
||||
};
|
||||
|
||||
retentionTime = mkOption {
|
||||
type = types.str;
|
||||
default = "15d";
|
||||
description = "Metrics retention period.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Prometheus TSDB
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
port = cfg.prometheusPort;
|
||||
retentionTime = cfg.retentionTime;
|
||||
extraFlags = [
|
||||
"--web.enable-remote-write-receiver"
|
||||
];
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "node";
|
||||
static_configs = [{
|
||||
targets = [ "127.0.0.1:${toString cfg.nodeExporterPort}" ];
|
||||
}];
|
||||
}
|
||||
{
|
||||
job_name = "naxos-api";
|
||||
static_configs = [{
|
||||
targets = [ "127.0.0.1:8088" ];
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Node exporter for hardware & OS metrics
|
||||
services.prometheus.exporters.node = {
|
||||
enable = true;
|
||||
port = cfg.nodeExporterPort;
|
||||
enabledCollectors = [
|
||||
"cpu"
|
||||
"diskstats"
|
||||
"filesystem"
|
||||
"loadavg"
|
||||
"meminfo"
|
||||
"netdev"
|
||||
"stat"
|
||||
"systemd"
|
||||
"thermal_zone"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user