Skip to content

Instantly share code, notes, and snippets.

@RaghavSood
Created June 6, 2020 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RaghavSood/e3b3287bacd078aa8720f4f021d59ad0 to your computer and use it in GitHub Desktop.
Save RaghavSood/e3b3287bacd078aa8720f4f021d59ad0 to your computer and use it in GitHub Desktop.
{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: ''${(lib.elemAt s.config.networking.interfaces.eth0.ipv4.addresses 0).address}'') nodes
}
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment