From f1dfb1f9768f061dcdcb9f3aacfa65c17235d697 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Thu, 31 Aug 2023 18:24:09 +0100 Subject: [PATCH] BRIDGE_VLAN_FILTERING depends on bridge _and_ vlan I'm half-pleased with this. It demonstrates how we can have complex conditional kernel config, but the way we detect if vlan exists is tacky. --- modules/bridge/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/bridge/default.nix b/modules/bridge/default.nix index dc1d071a..48fdb125 100644 --- a/modules/bridge/default.nix +++ b/modules/bridge/default.nix @@ -41,7 +41,11 @@ in }; config.kernel.config = { BRIDGE = "y"; - BRIDGE_VLAN_FILTERING = "y"; BRIDGE_IGMP_SNOOPING = "y"; - }; + } // lib.optionalAttrs (config.system.service ? vlan) { + # depends on bridge _and_ vlan. I would like there to be + # a better way to test for the existence of vlan config: + # maybe the module should set an `enabled` attribute? + BRIDGE_VLAN_FILTERING = "y"; + }; }