1{ lib, stdenv, fetchFromGitHub }:
2
3## Usage
4# In NixOS, simply add this package to services.udev.packages:
5# services.udev.packages = [ pkgs.android-udev-rules ];
6
7stdenv.mkDerivation rec {
8 pname = "android-udev-rules";
9 version = "20231030";
10
11 src = fetchFromGitHub {
12 owner = "M0Rf30";
13 repo = "android-udev-rules";
14 rev = version;
15 sha256 = "sha256-+h0FwvfIoluhldOi6cgVDvmNWe1Lvj1SV3pL8Zh+gRM=";
16 };
17
18 installPhase = ''
19 runHook preInstall
20 install -D 51-android.rules $out/lib/udev/rules.d/51-android.rules
21 runHook postInstall
22 '';
23
24 meta = with lib; {
25 homepage = "https://github.com/M0Rf30/android-udev-rules";
26 description = "Android udev rules list aimed to be the most comprehensive on the net";
27 platforms = platforms.linux;
28 license = licenses.gpl3Plus;
29 maintainers = with maintainers; [ abbradar ];
30 };
31}