networking/nftables: enable flushRuleset by default if rulset{,File} used

This commit is contained in:
Maciej Krüger 2023-03-27 20:09:46 +02:00
parent 55213b54f0
commit a1dd69d761
No known key found for this signature in database
GPG key ID: 0D948CE19CF49C5F

View file

@ -229,7 +229,8 @@ in
boot.blacklistedKernelModules = [ "ip_tables" ];
environment.systemPackages = [ pkgs.nftables ];
networking.networkmanager.firewallBackend = mkDefault "nftables";
networking.nftables.flushRuleset = mkDefault (versionOlder config.system.stateVersion "23.11");
# versionOlder for backportability, remove afterwards
networking.nftables.flushRuleset = mkDefault (versionOlder config.system.stateVersion "23.11" || (cfg.rulesetFile != null || cfg.ruleset != ""));
systemd.services.nftables = {
description = "nftables firewall";
before = [ "network-pre.target" ];