From 715f47635873cc8569b1afa6e878980be9de11bf Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 23 Nov 2026 04:54:37 +0000 Subject: tv.iptables: translate host names by the host's /etc/hosts --- modules/iptables.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/iptables.nix') diff --git a/modules/iptables.nix b/modules/iptables.nix index 0a8ee208..a2308183 100644 --- a/modules/iptables.nix +++ b/modules/iptables.nix @@ -273,8 +273,12 @@ ''; output = pkgs.runCommand "tv-iptables-${tool}-${table}-${chain}.nft" { nativeBuildInputs = [ pkgs.iptables ]; - # Service names like "smtp" need the host's /etc/services. - NIX_REDIRECTS = "/etc/services=${config.environment.etc.services.source}"; + # Service names like "smtp" and host names like "leg.r" need the + # host's /etc/services and /etc/hosts. + NIX_REDIRECTS = lib.concatStringsSep ":" [ + "/etc/hosts=${config.environment.etc.hosts.source}" + "/etc/services=${config.environment.etc.services.source}" + ]; LD_PRELOAD = "${pkgs.libredirect}/lib/libredirect.so"; } '' ${tool}-restore-translate -f ${input} > translated -- cgit v1.3.1