Skip to content

nixos/adb: switch to android-tools built from source#136040

Merged
primeos merged 1 commit intoNixOS:masterfrom
xaverdh:adb-open
Apr 3, 2022
Merged

nixos/adb: switch to android-tools built from source#136040
primeos merged 1 commit intoNixOS:masterfrom
xaverdh:adb-open

Conversation

@xaverdh
Copy link
Contributor

@xaverdh xaverdh commented Aug 28, 2021

Motivation for this change

Since #124992 we can build adb from source, so lets use it.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Aug 28, 2021
config = mkIf config.programs.adb.enable {
services.udev.packages = [ pkgs.android-udev-rules ];
# Give platform-tools lower priority so mke2fs+friends are taken from other packages first
environment.systemPackages = [ (lowPrio pkgs.androidenv.androidPkgs_9_0.platform-tools) ];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that android-tools has lowPrio applied in all-packages.nix already

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Aug 28, 2021
@xaverdh
Copy link
Contributor Author

xaverdh commented Aug 28, 2021

cc @Mic92

Copy link
Member

@primeos primeos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks :)

Only adb (and fastboot) should be required for this module but to document the differences:

$ ls -1 /nix/store/h0xj81jhac3b4aw7l08iqkg0a5pkmjli-android-tools-31.0.3p1/bin/
adb
append2simg
avbtool.py
fastboot
img2simg
lpadd
lpdump
lpflash
lpmake
lpunpack
mkbootimg
mke2fs.android
repack_bootimg
simg2img
unpack_bootimg
$ ls -1 /nix/store/dd0b1lx6s8fzrqqrs8pzj3sq7a84aiy1-platform-tools-31.0.3/bin/
adb
dmtracedump
e2fsdroid
etc1tool
fastboot
hprof-conv
make_f2fs
make_f2fs_casefold
mke2fs
mke2fs.conf
sload_f2fs

@primeos
Copy link
Member

primeos commented Apr 3, 2022

cc @svanderburg (FYI)

@primeos primeos merged commit a378300 into NixOS:master Apr 3, 2022
@xaverdh xaverdh deleted the adb-open branch April 4, 2022 06:51
@ghost
Copy link

ghost commented Jan 8, 2023

i had to use the platform tools folder in /nix/store to be able to use fastboot -w, otherwise, i get a "/nix/store/blah-android-tools-bla/bin/make_f2fs (exit status 1)", because it doesn't exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants