Skip to content

Instantly share code, notes, and snippets.

@RaghavSood RaghavSood/sample.nix Secret

Created Jun 6, 2020
Embed
What would you like to do?
{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
You can’t perform that action at this time.