ctucx.git: nixfiles

ctucx' nixfiles

commit e240cfceee2622e81f73f98f7d64f7906f6985e0
parent 35573708d5c871299ef0e143bdab82b31ae20e00
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sat, 9 Jul 2022 11:55:53 +0200

machines/lollo/smarthome/serial2tcp: update udev for jeelink, rename device
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/machines/lollo/smarthome/serial2tcp.nix b/machines/lollo/smarthome/serial2tcp.nix
@@ -15,17 +15,17 @@ let
 
 in {
 
-  services.udev.extraRules = ''SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="tempsensors0"'';
+  services.udev.extraRules = ''SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{serial}=="AL006SR4", SYMLINK+="jeelink0"'';
 
   systemd.services.serial2tcp = {
     wantedBy  = [ "multi-user.target" ];
-    requires  = [ "network-online.target" "dev-tempsensors0.device" ];
-    wants     = [ "network-online.target" "dev-tempsensors0.device" ];
-    after     = [ "network-online.target" "dev-tempsensors0.device" ];
+    requires  = [ "network-online.target" "dev-jeelink0.device" ];
+    wants     = [ "network-online.target" "dev-jeelink0.device" ];
+    after     = [ "network-online.target" "dev-jeelink0.device" ];
     onFailure = [ "notify-failure@%i.service" ];
 
     serviceConfig = {
-      ExecStartPre = "${pkgs.coreutils}/bin/stty -F /dev/tempsensors0 raw -echo -echoe -echok speed 9600";
+      ExecStartPre = "${pkgs.coreutils}/bin/stty -F /dev/jeelink0 raw -echo -echoe -echok speed 9600";
       ExecStart    = "${serial2tcp}/bin/serial2tcp";
       Restart      = "on-failure";
       RestartSec   = "5";

@@ -33,7 +33,7 @@ in {
 
     environment = {
       PORT          = "2342";
-      SERIAL_DEVICE = "/dev/tempsensors0";
+      SERIAL_DEVICE = "/dev/jeelink0";
     };
   };