better module

This commit is contained in:
Chris Dombroski 2024-09-07 19:23:41 -04:00
parent 0ac1fa9ed0
commit 554a906dbf

View file

@ -21,10 +21,10 @@ in
description = '' description = ''
Serial port for the Z-Wave controller. Serial port for the Z-Wave controller.
Used for permissions only; must be additionally set in the application Used for permissions only; must be additionally set in the application
''; '';
example = "/dev/ttyUSB0"; example = "/dev/ttyUSB0";
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [ assertions = [
@ -44,7 +44,10 @@ in
RuntimeDirectory = "zwave-js-ui"; RuntimeDirectory = "zwave-js-ui";
StateDirectory = "zwave-js-ui"; StateDirectory = "zwave-js-ui";
RootDirectory = "/run/zwave-js-ui"; RootDirectory = "/run/zwave-js-ui";
BindReadOnlyPaths = [ "/etc" "/nix/store" ]; BindReadOnlyPaths = [
"/etc"
"/nix/store"
];
BindPaths = [ "/var/lib/zwave-js-ui" ]; BindPaths = [ "/var/lib/zwave-js-ui" ];
DeviceAllow = [ cfg.serialPort ]; DeviceAllow = [ cfg.serialPort ];
DynamicUser = true; DynamicUser = true;