summary refs log tree commit diff
path: root/pkgs/os-specific/linux/trezor-udev-rules
diff options
context:
space:
mode:
authorPavol Rusnak <pavol@rusnak.io>2019-10-27 14:17:02 +0100
committerPavol Rusnak <pavol@rusnak.io>2019-10-30 15:15:22 +0100
commitd124858efebc9b027f271d75cc32523dca84485a (patch)
tree845536f67511ecf74c4541d9fd23f0e6d621d7c5 /pkgs/os-specific/linux/trezor-udev-rules
parent172601d4bf196a143e4b83a01a451ffd37b6c321 (diff)
downloadnixpkgs-d124858efebc9b027f271d75cc32523dca84485a.tar
nixpkgs-d124858efebc9b027f271d75cc32523dca84485a.tar.gz
nixpkgs-d124858efebc9b027f271d75cc32523dca84485a.tar.bz2
nixpkgs-d124858efebc9b027f271d75cc32523dca84485a.tar.lz
nixpkgs-d124858efebc9b027f271d75cc32523dca84485a.tar.xz
nixpkgs-d124858efebc9b027f271d75cc32523dca84485a.tar.zst
nixpkgs-d124858efebc9b027f271d75cc32523dca84485a.zip
trezor-udev-rules: init at unstable-2019-07-17
Diffstat (limited to 'pkgs/os-specific/linux/trezor-udev-rules')
-rw-r--r--pkgs/os-specific/linux/trezor-udev-rules/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/trezor-udev-rules/default.nix b/pkgs/os-specific/linux/trezor-udev-rules/default.nix
new file mode 100644
index 00000000000..c2be8137376
--- /dev/null
+++ b/pkgs/os-specific/linux/trezor-udev-rules/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "trezor-udev-rules";
+  version = "unstable-2019-07-17";
+
+  udevRules = fetchurl {
+    # let's pin the latest commit in the repo which touched the udev rules file
+    url = "https://raw.githubusercontent.com/trezor/trezor-firmware/68a3094b0a8e36b588b1bcb58c34a2c9eafc0dca/common/udev/51-trezor.rules";
+    sha256 = "0vlxif89nsqpbnbz1vwfgpl1zayzmq87gw1snskn0qns6x2rpczk";
+  };
+
+  dontUnpack = true;
+
+  installPhase = ''
+    cp ${udevRules} 51-trezor.rules
+    mkdir -p $out/lib/udev/rules.d
+    # we use trezord group, not plugdev
+    # we don't need the udev-acl tag
+    substituteInPlace 51-trezor.rules \
+      --replace 'GROUP="plugdev"' 'GROUP="trezord"' \
+      --replace ', TAG+="udev-acl"' ""
+    cp 51-trezor.rules $out/lib/udev/rules.d/51-trezor.rules
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Udev rules for Trezor";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ prusnak ];
+    platforms = platforms.linux;
+    homepage = "https://github.com/trezor/trezor-firmware/tree/master/common/udev";
+  };
+}