diff --git a/nixos/modules/services/home-automation/zigbee2mqtt.nix b/nixos/modules/services/home-automation/zigbee2mqtt.nix index 5a9fb0eaebc1..a3d5c868fb38 100644 --- a/nixos/modules/services/home-automation/zigbee2mqtt.nix +++ b/nixos/modules/services/home-automation/zigbee2mqtt.nix @@ -76,9 +76,7 @@ in # Hardening CapabilityBoundingSet = ""; - DeviceAllow = [ - config.services.zigbee2mqtt.settings.serial.port - ]; + DeviceAllow = lib.optionals (lib.hasPrefix "/" cfg.settings.serial.port) [ cfg.settings.serial.port ]; DevicePolicy = "closed"; LockPersonality = true; MemoryDenyWriteExecute = false;