summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2025-08-10 16:34:57 +0200
committerFlorian Klink <flokli@flokli.de>2025-08-10 16:37:42 +0200
commitb45ba94a0ed9b0a04c5d569d4994f546c1849797 (patch)
treefe9f322a2f375666f51d750fbfc418d3aa298f1e
parentnixosTests.tayga: add tcpdump to systemPackages (diff)
downloadnixpkgs-b45ba94a0ed9b0a04c5d569d4994f546c1849797.tar.gz
nixos/tayga: add log option
This allows configuring logging in tayga, and enables it for the NixOS test.
-rw-r--r--nixos/modules/services/networking/tayga.nix13
-rw-r--r--nixos/tests/tayga.nix12
2 files changed, 25 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/tayga.nix b/nixos/modules/services/networking/tayga.nix
index bac0005781b2..047c9ba396be 100644
--- a/nixos/modules/services/networking/tayga.nix
+++ b/nixos/modules/services/networking/tayga.nix
@@ -23,6 +23,10 @@ let
data-dir ${cfg.dataDir}
${concatStringsSep "\n" (mapAttrsToList (ipv4: ipv6: "map " + ipv4 + " " + ipv6) cfg.mappings)}
+
+ ${optionalString ((builtins.length cfg.log) > 0) ''
+ log ${concatStringsSep " " cfg.log}
+ ''}
'';
addrOpts =
@@ -132,6 +136,15 @@ in
}
'';
};
+
+ log = mkOption {
+ type = types.listOf types.str;
+ default = [ ];
+ description = "Packet errors to log (drop, reject, icmp, self)";
+ example = literalExpression ''
+ [ "drop" "reject" "icmp" "self" ]
+ '';
+ };
};
};
diff --git a/nixos/tests/tayga.nix b/nixos/tests/tayga.nix
index 4a7d1e304f6a..5076a05c884b 100644
--- a/nixos/tests/tayga.nix
+++ b/nixos/tests/tayga.nix
@@ -139,6 +139,12 @@
mappings = {
"192.0.2.42" = "2001:db8::2";
};
+ log = [
+ "drop"
+ "reject"
+ "icmp"
+ "self"
+ ];
};
environment.systemPackages = [ pkgs.tcpdump ];
};
@@ -205,6 +211,12 @@
mappings = {
"192.0.2.42" = "2001:db8::2";
};
+ log = [
+ "drop"
+ "reject"
+ "icmp"
+ "self"
+ ];
};
environment.systemPackages = [ pkgs.tcpdump ];
};