nixos/tayga: add log option

This allows configuring logging in tayga, and enables it for the NixOS
test.
This commit is contained in:
Luke Granger-Brown 2025-08-10 16:34:57 +02:00 committed by Florian Klink
parent c204edcb7c
commit b45ba94a0e
2 changed files with 25 additions and 0 deletions

View File

@ -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" ]
'';
};
};
};

View File

@ -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 ];
};