summary refs log tree commit diff
path: root/pkgs/os-specific/linux/teensy-udev-rules/default.nix
blob: e3d50eee5f67585342124f1021a5daf28a9ebaa9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, stdenv, coreutils }:

stdenv.mkDerivation {
  pname = "teensy-udev-rules";
  version = "2022-05-15";

  # Source: https://www.pjrc.com/teensy/00-teensy.rules
  src = ./teensy.rules;

  dontUnpack = true;

  runtimeDeps = [ coreutils ];

  installPhase = ''
    install -D $src $out/etc/udev/rules.d/70-teensy.rules
    substituteInPlace $out/etc/udev/rules.d/70-teensy.rules \
      --replace "/bin/stty" "${coreutils}/bin/stty"
  '';

  meta = with lib; {
    homepage = "https://www.pjrc.com/teensy/00-teensy.rules";
    description = ''
      udev rules that give non-root users permission to communicate with the
      Teensy family of microcontrolers.

      ModemManager (part of NetworkManager) can interfere with USB Serial
      devices, which includes the Teensy.  See comments in the .rules file (or
      this package's homepage) for possible workarounds.
    '';
    platforms = platforms.linux;
    license = "unknown";
    maintainers = with maintainers; [ aidalgol ];
  };
}