Skip to content

Commit 577e162

Browse files
committed
nixos/zigbee2mqtt: only add port to DeviceAllow if it is a path
zigbee2mqtt supports having non-device ports (e.g. `tcp://`); those should not be set in DeviceAllow. No URI will start with `/`, so use that as the filter that it is a “real” device that needs to be allowed.
1 parent dc460ec commit 577e162

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

nixos/modules/services/home-automation/zigbee2mqtt.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ in
7676

7777
# Hardening
7878
CapabilityBoundingSet = "";
79-
DeviceAllow = [
80-
config.services.zigbee2mqtt.settings.serial.port
81-
];
79+
DeviceAllow = lib.optionals (lib.hasPrefix "/" cfg.settings.serial.port) [ cfg.settings.serial.port ];
8280
DevicePolicy = "closed";
8381
LockPersonality = true;
8482
MemoryDenyWriteExecute = false;

0 commit comments

Comments
 (0)