Skip to content

Commit b45ba94

Browse files
lukegbflokli
authored andcommitted
nixos/tayga: add log option
This allows configuring logging in tayga, and enables it for the NixOS test.
1 parent c204edc commit b45ba94

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

nixos/modules/services/networking/tayga.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ let
2323
data-dir ${cfg.dataDir}
2424
2525
${concatStringsSep "\n" (mapAttrsToList (ipv4: ipv6: "map " + ipv4 + " " + ipv6) cfg.mappings)}
26+
27+
${optionalString ((builtins.length cfg.log) > 0) ''
28+
log ${concatStringsSep " " cfg.log}
29+
''}
2630
'';
2731

2832
addrOpts =
@@ -132,6 +136,15 @@ in
132136
}
133137
'';
134138
};
139+
140+
log = mkOption {
141+
type = types.listOf types.str;
142+
default = [ ];
143+
description = "Packet errors to log (drop, reject, icmp, self)";
144+
example = literalExpression ''
145+
[ "drop" "reject" "icmp" "self" ]
146+
'';
147+
};
135148
};
136149
};
137150

nixos/tests/tayga.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@
139139
mappings = {
140140
"192.0.2.42" = "2001:db8::2";
141141
};
142+
log = [
143+
"drop"
144+
"reject"
145+
"icmp"
146+
"self"
147+
];
142148
};
143149
environment.systemPackages = [ pkgs.tcpdump ];
144150
};
@@ -205,6 +211,12 @@
205211
mappings = {
206212
"192.0.2.42" = "2001:db8::2";
207213
};
214+
log = [
215+
"drop"
216+
"reject"
217+
"icmp"
218+
"self"
219+
];
208220
};
209221
environment.systemPackages = [ pkgs.tcpdump ];
210222
};

0 commit comments

Comments
 (0)