{ lib, iptables, fetchFromGitHub, buildGoModule, }: buildGoModule rec { pname = "gerbil"; version = "1.1.0"; src = fetchFromGitHub { owner = "fosrl"; repo = "gerbil"; tag = version; hash = "sha256-vfeI3GNI910FQmHK53E6yPrWF3tQtjrpQ/oP2PcDzs4="; }; vendorHash = "sha256-m6UfW+DVT0T/t7fiqZXc2ihg2O07C7LnR0uy4FDWPCA="; # patch out the /usr/sbin/iptables postPatch = '' substituteInPlace main.go \ --replace-fail '/usr/sbin/iptables' '${lib.getExe iptables}' ''; meta = { description = "Simple WireGuard interface management server"; mainProgram = "gerbil"; homepage = "https://github.com/fosrl/gerbil"; changelog = "https://github.com/fosrl/gerbil/releases/tag/${version}"; license = lib.licenses.agpl3Only; maintainers = with lib.maintainers; [ jackr sigmasquadron ]; platforms = lib.platforms.linux; }; }