-
-
Save RaghavSood/bc440ca547fab044603d9ca3408d4504 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{pkgs ? import<nixpkgs>, nodes, lib, ...}: { | |
services.netdata = { | |
enable = true; | |
config = { | |
registry = { | |
"enabled" = "yes"; | |
"registry to announce" = "http://${(lib.elemAt nodes.ch-misc.config.networking.interfaces.eth0.ipv4.addresses 0).addres | |
s}:19999"; | |
}; | |
}; | |
}; | |
networking.firewall.extraCommands = '' | |
iptables -A nixos-fw -s 167.99.64.211/32 -p tcp -m tcp --dport 19999 -m comment --comment netdata -j nixos-fw-accept | |
${lib.concatMapStringsSep "\n" (s: ''iptables -A nixos-fw -s ${(lib.elemAt nodes.${s}.config.networking.interfaces.eth0. | |
ipv4.addresses 0).address}/32 -p tcp -m tcp --dport 19999 -m comment --comment netdata -j nixos-fw-accept'') (lib.attrNames nod | |
es) } | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment