fix: add default value for custom rules

This commit is contained in:
2025-04-29 10:04:26 +02:00
parent 4f7e5bc326
commit 967467e151

View File

@@ -149,6 +149,7 @@ in {
custom-rules = { custom-rules = {
input = lib.mkOption { input = lib.mkOption {
type = with types; nullOr lines; type = with types; nullOr lines;
default = '''';
example = '' example = ''
iifname "lan" udp dport 22 counter accept comment "Wireguard traffic" iifname "lan" udp dport 22 counter accept comment "Wireguard traffic"
iifname "lan" udp dport 80 counter accept comment "Wireguard traffic" iifname "lan" udp dport 80 counter accept comment "Wireguard traffic"
@@ -157,6 +158,7 @@ in {
}; };
forward = lib.mkOption { forward = lib.mkOption {
type = with types; nullOr lines; type = with types; nullOr lines;
default = '''';
example = '' example = ''
iifname "lan" oifname "server" tcp dport { 22 } counter accept iifname "lan" oifname "server" tcp dport { 22 } counter accept
iifname "lan" oifname "server" tcp dport { 80 } counter accept iifname "lan" oifname "server" tcp dport { 80 } counter accept
@@ -165,6 +167,7 @@ in {
}; };
prerouting = lib.mkOption { prerouting = lib.mkOption {
type = with types; nullOr lines; type = with types; nullOr lines;
default = '''';
example = '' example = ''
iifname "server" ip daddr 10.0.96.255 udp dport { 9 } dnat to 10.0.96.255 iifname "server" ip daddr 10.0.96.255 udp dport { 9 } dnat to 10.0.96.255
''; '';
@@ -172,6 +175,7 @@ in {
}; };
postrouting = lib.mkOption { postrouting = lib.mkOption {
type = with types; nullOr lines; type = with types; nullOr lines;
default = '''';
example = '' example = ''
oifname { "wan" } masquerade oifname { "wan" } masquerade
''; '';