Add android config

This commit is contained in:
Alexander
2026-08-17 22:02:42 +02:00
parent b471966e8a
commit 9eed9f81d4
2 changed files with 44 additions and 0 deletions
+1
View File
@@ -117,6 +117,7 @@
version = "1.19.2";
hash = "sha256-/P3UStsRHKKWC1xET9SL23E0CUPxQ5DkmWFco+dH37A="; # nix store prefetch-file --json https://download.qoder.com/release/latest/qoder_amd64.deb | jq -r .hash
};
development.android.enable = true;
virtualisation.docker.enable = true;
virtualisation.incus.enable = true;
+43
View File
@@ -0,0 +1,43 @@
{
config,
lib,
pkgs,
username,
...
}:
let
cfg = config.dov.development.android;
mtk-udev-rules = pkgs.writeTextFile {
name = "mtk-udev-rules";
destination = "/etc/udev/rules.d/60-mtk.rules";
text = ''
# MediaTek BROM (0003), Preloader VCOM (2000/2001), META (6000)
SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", MODE="0666", TAG+="uaccess"
# Oppo/Realme fastboot + adb
SUBSYSTEM=="usb", ATTR{idVendor}=="22d9", MODE="0666", TAG+="uaccess"
# keep ModemManager's hands off the preloader port
SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0e8d", ENV{ID_MM_DEVICE_IGNORE}="1"
'';
};
in
{
options.dov.development.android = {
enable = lib.mkEnableOption "Android and MediaTek flashing tools";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
android-tools
mtkclient
usbutils
];
users.users.${username}.extraGroups = [ "dialout" ];
services.udev.packages = [ mtk-udev-rules ];
};
}