From ba9b26144e0f747d6d969a5029987c2aa53dbe96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Capucho?= Date: Wed, 26 Jan 2022 11:10:10 +0000 Subject: [PATCH] usb-blaster-udev-rules: init --- .../linux/usb-blaster-udev-rules/default.nix | 26 +++++++++++++++++++ .../usb-blaster-udev-rules/usb-blaster.rules | 8 ++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 36 insertions(+) create mode 100644 pkgs/os-specific/linux/usb-blaster-udev-rules/default.nix create mode 100644 pkgs/os-specific/linux/usb-blaster-udev-rules/usb-blaster.rules diff --git a/pkgs/os-specific/linux/usb-blaster-udev-rules/default.nix b/pkgs/os-specific/linux/usb-blaster-udev-rules/default.nix new file mode 100644 index 000000000000..d04c8ddb9398 --- /dev/null +++ b/pkgs/os-specific/linux/usb-blaster-udev-rules/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenvNoCC }: + +stdenvNoCC.mkDerivation rec { + name = "usb-blaster-udev-rules"; + + udevRules = ./usb-blaster.rules; + dontUnpack = true; + + installPhase = '' + install -Dm 644 "${udevRules}" "$out/lib/udev/rules.d/51-usbblaster.rules" + ''; + + meta = with lib; { + description = "udev rules that give NixOS permission to communicate with usb blasters"; + longDescription = '' + udev rules that give NixOS permission to communicate with usb blasters. + To use it under NixOS, add + + services.udev.packages = [ pkgs.usb-blaster-udev-rules ]; + + to the system configuration. + ''; + license = licenses.free; + platforms = platforms.linux; + }; +} diff --git a/pkgs/os-specific/linux/usb-blaster-udev-rules/usb-blaster.rules b/pkgs/os-specific/linux/usb-blaster-udev-rules/usb-blaster.rules new file mode 100644 index 000000000000..0add604ee819 --- /dev/null +++ b/pkgs/os-specific/linux/usb-blaster-udev-rules/usb-blaster.rules @@ -0,0 +1,8 @@ +# USB-Blaster +ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", TAG+="uaccess" +ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6002", TAG+="uaccess" +ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6003", TAG+="uaccess" + +# USB-Blaster II +ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6010", TAG+="uaccess" +ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6810", TAG+="uaccess" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c7ff11e184f8..10c83a49f723 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34424,6 +34424,8 @@ with pkgs; quartus-prime-lite = callPackage ../applications/editors/quartus-prime {}; + usb-blaster-udev-rules = callPackage ../os-specific/linux/usb-blaster-udev-rules {}; + go-license-detector = callPackage ../development/tools/misc/go-license-detector { }; hashdeep = callPackage ../tools/security/hashdeep { };