This configuration provides comprehensive Android OTG/MTP connectivity support for NixOS desktop systems.
- ADB (Android Debug Bridge): For debugging and file transfer
- MTP Support: Multiple MTP filesystem implementations
- USB Device Management: Proper udev rules and permissions
- GVFS: Virtual filesystem for seamless integration
android-tools(adb, fastboot)android-udev-rules(USB device rules)jmtpfs,go-mtpfs,simple-mtpfs(MTP filesystems)libmtp(MTP library)usbutils(USB utilities)
adb(Android Debug Bridge)gvfs(GNOME Virtual File System)devmon(Device automounter)
- On your Android device, enable "File Transfer" or "MTP" mode
- For advanced features, enable "USB Debugging" in Developer Options
- Connect via USB cable
File Managers:
- GNOME Files: Should automatically detect and show your device
- KDE Dolphin: Should automatically detect and show your device
- Thunar: Should automatically detect and show your device
Command Line:
# List connected devices
adb devices
# List MTP devices
simple-mtpfs --list-devices
# Mount manually (if needed)
mkdir -p ~/mtp
simple-mtpfs --device 1 ~/mtp
# Unmount
fusermount -u ~/mtpRun the provided test script:
./test-android-connectivity.sh- Check USB Mode: Ensure your Android device is in "File Transfer" or "MTP" mode
- Try Different Cable/Port: Some cables/ports don't support data transfer
- Restart Services:
sudo systemctl restart adb - Replug Device: Unplug and replug your Android device
- Check User Group: Ensure your user is in the
adbusersgroup - Re-login: You may need to relogin after group changes
- Check udev Rules: Ensure
android-udev-rulesis installed
- File Manager Support: Some Wayland file managers have limited MTP support
- Manual Mount: Try mounting manually with
simple-mtpfs - Alternative Tools: Try
jmtpfsorgo-mtpfsifsimple-mtpfsdoesn't work
- Enable Debugging: Make sure "USB Debugging" is enabled in Developer Options
- Authorize Device: Accept the authorization prompt on your Android device
- Restart ADB Server:
sudo adb kill-server && sudo adb start-server
Your user is automatically added to the adbusers group for USB device access.
Comprehensive udev rules are included for:
- Common Android device vendors
- MTP device detection
- Proper USB permissions
Required kernel modules are loaded:
usb_storage(USB mass storage)usbcore(USB core)usb_common(USB common)uas(USB Attached SCSI)
- Configuration:
nixos/android-connectivity/default.nix - Test Script:
test-android-connectivity.sh - Hardware Config:
nixos/hardware-configuration/framework/*/default.nix
This configuration supports both Framework laptop models:
- Framework 13-inch 12th Gen Intel
- Framework 13-inch 7040 AMD
The configuration should work with most Android devices from major manufacturers (Google, Samsung, Motorola, OnePlus, etc.).