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.
This commit is contained in:
parent
dc460ec76c
commit
577e162073
@ -76,9 +76,7 @@ in
|
|||||||
|
|
||||||
# Hardening
|
# Hardening
|
||||||
CapabilityBoundingSet = "";
|
CapabilityBoundingSet = "";
|
||||||
DeviceAllow = [
|
DeviceAllow = lib.optionals (lib.hasPrefix "/" cfg.settings.serial.port) [ cfg.settings.serial.port ];
|
||||||
config.services.zigbee2mqtt.settings.serial.port
|
|
||||||
];
|
|
||||||
DevicePolicy = "closed";
|
DevicePolicy = "closed";
|
||||||
LockPersonality = true;
|
LockPersonality = true;
|
||||||
MemoryDenyWriteExecute = false;
|
MemoryDenyWriteExecute = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user