mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-12-05 00:05:04 +01:00
36 lines
1.2 KiB
Nix
36 lines
1.2 KiB
Nix
{ config, pkgs, ... }:
|
|
{
|
|
# adb and fastboot
|
|
|
|
# https://nixos.wiki/wiki/Android#adb_setup
|
|
programs.adb.enable = true;
|
|
users.users.yoda.extraGroups = [ "adbusers" "plugdev" ];
|
|
|
|
# plugdev group: https://developer.android.com/studio/run/device
|
|
# How to add user to new group: https://superuser.com/a/1352988
|
|
users.groups.plugdev = {};
|
|
|
|
# `adb devices` returned the error: no permissions (missing udev rules? user is in the plugdev group)
|
|
# So I troed two things. The first one had no effect. But the second one fixed it.
|
|
|
|
#services.udev.packages = [
|
|
# pkgs.android-udev-rules
|
|
#];
|
|
|
|
# `lsusb`
|
|
#=> Bus 001 Device 008: ID 2a70:d001 OnePlus Technology (Shenzhen) Co., Ltd. ONEPLUS A6003
|
|
# https://stackoverflow.com/a/53887437
|
|
#
|
|
# sudo udevadm control --reload-rules
|
|
#
|
|
# After adding this, `adb devices` returnes:
|
|
#=> List of devices attached
|
|
#=> 21801e97 sideload
|
|
#
|
|
# Added to head of /etc/udev/rules.d/99-local.rules
|
|
services.udev.extraRules = ''
|
|
SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", ATTR{idProduct}=="d001", MODE="0666", GROUP="plugdev"
|
|
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="0000", MODE="0666", GROUP="plugdev"
|
|
'';
|
|
}
|