aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-09-13 09:54:14 +0200
committerKarel Kočí <cynerd@email.cz>2023-09-13 09:54:14 +0200
commit87249a5408b608da7c83144ccb4abf7e06c5ba3a (patch)
tree9c2e73179e9cf75c50089b1119fbc0be989978d1
parentbfdd9ca1dfa45a9fae3b1db09fa87f26ee30442f (diff)
downloadnixos-personal-87249a5408b608da7c83144ccb4abf7e06c5ba3a.tar.gz
nixos-personal-87249a5408b608da7c83144ccb4abf7e06c5ba3a.tar.bz2
nixos-personal-87249a5408b608da7c83144ccb4abf7e06c5ba3a.zip
nixos/monitoring: cleanup
-rw-r--r--nixos/modules/monitoring.nix16
1 files changed, 3 insertions, 13 deletions
diff --git a/nixos/modules/monitoring.nix b/nixos/modules/monitoring.nix
index 36cd387..2fc6da5 100644
--- a/nixos/modules/monitoring.nix
+++ b/nixos/modules/monitoring.nix
@@ -6,8 +6,6 @@
}:
with lib; let
cnf = config.cynerd.monitoring;
- inherit (config.networking) hostName;
- isHost = cnf.host == hostName || hostName == "errol";
in {
options.cynerd.monitoring = {
enable = mkOption {
@@ -25,17 +23,9 @@ in {
default = false;
description = "If speedtest should be used to measure connection speed";
};
-
- host = mkOption {
- type = types.str;
- description = "Host name of the monitoring hosting system";
- readOnly = true;
- };
};
config = mkMerge [
- {cynerd.monitoring.host = "lipwig";}
-
(mkIf cnf.enable {
# Telegraf configuration
services.telegraf = {
@@ -127,14 +117,14 @@ in {
];
})
- (mkIf isHost {
+ (mkIf (config.networking.hostName == "lipwig") {
# InfluxDB
- services.influxdb2.enable = mkIf isHost true;
+ services.influxdb2.enable = true;
services.telegraf.extraConfig.inputs.prometheus = {
urls = ["http://localhost:8086/metrics"];
};
# Grafana
- services.grafana = mkIf isHost {
+ services.grafana = {
enable = true;
settings = {
users.allow_sign_up = false;