Using nodes instead of hardcoded server names

Might not work probably did smnth wrong
This commit is contained in:
daragh 2024-05-21 18:23:56 +01:00
parent 7f5f21dc8a
commit cf600e2dc1
No known key found for this signature in database
2 changed files with 7 additions and 21 deletions

View file

@ -10,6 +10,11 @@ in {
imports = []; imports = [];
options.services.skynet."${name}" = { options.services.skynet."${name}" = {
#list of servers passed in for monitoring
servers = mkOption {
type = types.listOf types.str;
};
server = { server = {
enable = mkEnableOption "Prometheus Server"; enable = mkEnableOption "Prometheus Server";
host = { host = {
@ -26,10 +31,6 @@ in {
type = types.port; type = types.port;
default = 9001; default = 9001;
}; };
#list of servers passed in for monitoring
servers = mkOption {
type = types.listOf types.str;
};
}; };
collecter_port = mkOption { collecter_port = mkOption {

View file

@ -59,25 +59,10 @@ in {
}; };
port = 9001; port = 9001;
servers = [
"agentjones"
"cadie"
"earth"
"galatea"
"gir"
"glados"
"kitt"
"marvin"
"neuromancer"
"optimus"
"skynet"
"vendetta"
"vigil"
"wheatly"
];
}; };
services.skynet.prometheus.servers = lib.attrsets.mapAttrsToList (server: server.name) nodes;
services.skynet.grafana = { services.skynet.grafana = {
enable = true; enable = true;