From 91bcf2b4f16b95d9fb590f79e18306ede3eaf891 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Fri, 6 Dec 2024 19:38:50 +0000 Subject: [PATCH] use cynthion from nixpkgs --- externals/rules/cynthion.nix | 7 +++++++ externals/rules/cynthion.rules | 16 ++++++++++++++++ sets/hardware.nix | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 externals/rules/cynthion.nix create mode 100644 externals/rules/cynthion.rules diff --git a/externals/rules/cynthion.nix b/externals/rules/cynthion.nix new file mode 100644 index 0000000..c1321f3 --- /dev/null +++ b/externals/rules/cynthion.nix @@ -0,0 +1,7 @@ +{ writeTextFile }: + +writeTextFile { + name = "cynthion-udev-rules"; + text = builtins.readFile ./cynthion.rules; + destination = "/etc/udev/rules.d/54-cynthion.rules"; +} diff --git a/externals/rules/cynthion.rules b/externals/rules/cynthion.rules new file mode 100644 index 0000000..6da1054 --- /dev/null +++ b/externals/rules/cynthion.rules @@ -0,0 +1,16 @@ +# Configures Linux to allow access to Cynthion hardware for anyone logged into the physical terminal. +# +# # install udev rules +# sudo cp 54-cynthion.rules /etc/udev/rules.d +# +# # reload udev rules +# sudo udevadm control --reload +# +# # apply udev rules to any devices that are already plugged in +# sudo udevadm trigger + +SUBSYSTEM=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="615b", SYMLINK+="cynthion-%k", TAG+="uaccess" +SUBSYSTEM=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="615c", SYMLINK+="cynthion-apollo-%k", TAG+="uaccess" + +SUBSYSTEM=="usb", ATTR{idVendor}=="1209", ATTR{idProduct}=="000a", SYMLINK+="cynthion-test-%k", TAG+="uaccess" +SUBSYSTEM=="usb", ATTR{idVendor}=="1209", ATTR{idProduct}=="000e", SYMLINK+="cynthion-example-%k", TAG+="uaccess" diff --git a/sets/hardware.nix b/sets/hardware.nix index 8fd3465..b25b411 100644 --- a/sets/hardware.nix +++ b/sets/hardware.nix @@ -2,6 +2,7 @@ { services.udev.packages = with pkgs; [ (callPackage ../externals/rules/adafruit.nix { }) + (callPackage ../externals/rules/cynthion.nix { }) (callPackage ../externals/rules/limesuite.nix { }) glasgow libsigrok @@ -10,6 +11,7 @@ ]; environment.systemPackages = with pkgs; [ + cynthion glasgow jlink kicad