From c929afa9f3513eb457aa72762514ccfd3407dcb7 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 20 Jul 2019 00:09:47 +0200 Subject: [PATCH] wolf.r: grafana to seperate config --- krebs/1systems/wolf/config.nix | 14 +++----------- krebs/2configs/shack/grafana.nix | 19 +++++++++++++++++++ krebs/2configs/shack/influx.nix | 3 ++- 3 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 krebs/2configs/shack/grafana.nix diff --git a/krebs/1systems/wolf/config.nix b/krebs/1systems/wolf/config.nix index 3c3cf61fa..f3db30fc4 100644 --- a/krebs/1systems/wolf/config.nix +++ b/krebs/1systems/wolf/config.nix @@ -1,7 +1,6 @@ { config, pkgs, ... }: let shack-ip = config.krebs.build.host.nets.shack.ip4.addr; - influx-host = "127.0.0.1"; ext-if = "et0"; external-mac = "52:54:b0:0b:af:fe"; @@ -56,11 +55,13 @@ in + # prometheus.shack + # grafana.shack + # home-assistant - { services.influxdb.enable = true; } ]; # use your own binary cache, fallback use cache.nixos.org (which is used by @@ -70,15 +71,6 @@ in # local discovery in shackspace nixpkgs.config.packageOverrides = pkgs: { tinc = pkgs.tinc_pre; }; krebs.tinc.retiolum.extraConfig = "TCPOnly = yes"; - services.grafana = { - enable = true; - addr = "0.0.0.0"; - users.allowSignUp = true; - users.allowOrgCreate = true; - users.autoAssignOrg = true; - auth.anonymous.enable = true; - security = import ; - }; nix = { # use the up to date prism cache diff --git a/krebs/2configs/shack/grafana.nix b/krebs/2configs/shack/grafana.nix new file mode 100644 index 000000000..adf0a4bc3 --- /dev/null +++ b/krebs/2configs/shack/grafana.nix @@ -0,0 +1,19 @@ +let + port = 3000; +in { + + networking.firewall.allowedTCPPorts = [ port ]; # legacy + services.nginx.virtualHosts."grafana.shack" = { + locations."/".proxyPass = "http://localhost:${toString port}"; + }; + services.grafana = { + enable = true; + port = port; + addr = "0.0.0.0"; + users.allowSignUp = true; + users.allowOrgCreate = true; + users.autoAssignOrg = true; + auth.anonymous.enable = true; + security = import ; + }; +} diff --git a/krebs/2configs/shack/influx.nix b/krebs/2configs/shack/influx.nix index 599416c97..91b4fa9b7 100644 --- a/krebs/2configs/shack/influx.nix +++ b/krebs/2configs/shack/influx.nix @@ -1,3 +1,4 @@ +# hostname: influx.shack let port = 8086; in @@ -11,7 +12,7 @@ in services.influxdb = { enable = true; extraConfig = { - bind-address = ":${toString port}"; + http.bind-address = "0.0.0.0:${toString port}"; http.log-enabled = false; }; };