Hacker News new | ask | show | jobs
by fallingsquirrel 605 days ago
Sure, but it won't successfully connect to a real device unless you somehow know to also set `programs.adb.enable = true`.
1 comments

That's not nixos specific. You get special instructions for Ubuntu https://help.ubuntu.com/community/AndroidSDK Arch https://wiki.archlinux.org/title/Android_Debug_Bridge Gentoo https://wiki.gentoo.org/wiki/Android/adb ...

And the adb option is in the docs with a description of what to do https://nixos.org/manual/nixos/stable/options#opt-programs.a...

Yes, I know that and you know that. But GP wanted to install the package and move on with his life instead of debugging a connection that failed with no indication why on an unfamiliar OS.

https://search.nixos.org/packages?channel=24.05&show=android...

> How to install android-tools?

> environment.systemPackages = [ pkgs.android-tools ];

How was he supposed to know to ignore those instructions and go to a completely different set of docs and search for "programs.adb.enable"?

Instead he gave up and switched to another distro where you install the package and it Just Works™. Even though NixOS's model is conceptually better, it loses out on tons of potential users because of usability problems like this.

(I'm running NixOS btw)

IMHO, a couple of major issues with this are some properties of Nix documentation websites, that make them not popup in search engines on certain queries.

In this particular case it would be great to have "nixos Android SDK" or "nixos adb" return either a hypothetical page like "NixOS.org/programs/adb" or at least "wiki.NixOS.org/pages/Android-SDK". There's a problem with "nixos.wiki" showing up instead. If both are controlled by the community, "NixOS.wiki" should instead do permanent redirects to "wiki.nixos.org" so that search engines would correctly show it.

Somebody really needs to work on this, this hurts the adoption A LOT.

Edit viraptor in the sibling said it is the fault of user they didn't use documentation. No, it is not. We've known for long that global search is much better interface to docs, the approach with custom UX and per-feature search (in Nix: programs, services, setup instructions, wiki, options, etc) just sucks and needs to support the efficient one.

Sometimes you just need to put in some work and understand what you're doing. The author needed to search for "adb" in the docs, not the whole attribute path. With the errors, they could debug the issue like they would on any other system.

But that search is for packages themselves and is correct - that's how you install it. It's not going to tell you about the configuration just like it doesn't for nginx, postgresql, or many other packages. Sometimes you "have to be this high to ride", or use a simpler system - but that comes with its own issues.

(Although in this very specific example it could just to make life easier - I'll send a PR next week unless someone does it first)

Why is this extra completion acceptable? On Debian I install the package adb and get the udev rules with it. I just need to connect a device and run adb commands.
Because nixos manages your system and nixpkgs only contains packages. Packages cannot do anything outside their installed location, so can't touch udev or groups to make the changes. There will be other apps split in the same way.

The benefit is that just adding some package will never break your own configuration.

For the same reason that people get used to quirks on Debian (or any other distro really) that then eventually get fixed.

Nobody's perfect, you live and you learn it. I use Hannah Montanix btw

https://youtube.com/watch?v=2DQla5j26Qc

nixos is open source, I'm sure they'd welcome your proposed changes! they accept patches on GitHub.
Please, see a sibling.
> no indication why on an unfamiliar OS.

to be fair, I feel exactly that way on Windows after not using it for two decades (I only use it as a thin client now).