Hacker News new | past | comments | ask | show | jobs | submit login
Termux is an Android terminal emulator and Linux environment app (termux.dev)
335 points by thunderbong on April 29, 2023 | hide | past | favorite | 169 comments



Termux singlehandedly makes me feel like I'm living my childhood dream of having a full computer in my pocket. I use git to blog from my phone, I have ffmpeg and yt-dlp installed to download videos for when I am going to be away from internet access for a while, and I even have some home automation scripts setup that control the lights over the local network. But I am concerned about the direction Android is headed, Google policies have been aligning closer to Apple's. I don't like having to stay on a previous generation OS just to make sure I don't lose "power user" fuctionality. Just recently I had to install a root mod to allow apps complete access to SD cards, a recent update caused me to get the dreaded "To protect your privacy, choose another folder" while trying to give a gallery app permissions. I am grateful for Termux devs for working hard to maintain functionality via workarounds.

https://github.com/termux/termux-app/issues/2366


I really wish Android would properly enable containers like they've done for Chrome OS. It's silly we run little Linux machines and can't pop a fully isolated container shell on them!



I think it hasn't happened because much of the sandboxing of Android is part of the Android runtime, thereby only sandboxing code compiled for the Android runtime. If you could spawn a native Linux executable (that hasn't been compiled for Android the way the Termux executables have) from an Android application, then that process can escape the application's sandbox and do stuff it shouldn't be able to do given the permissions granted to the Android application.

That just means no container-based virtualization, though. There's nothing stopping a sufficiently-powerful Android device from running a Linux virtual machine, presuming that the hypervisor is implemented as a regular Android application using regular Android-runtime APIs.


Android 13+ includes a crosvm based virtulization setup: https://source.android.com/docs/core/virtualization

> ...then that process can escape the application's sandbox and do stuff it shouldn't be able to do given the permissions granted to the Android application.

Android's sandboxing is not limited to ART and has multiple layers [0]. Native apps cannot bypass sandboxing, I don't think.

[0] https://hernan.de/blog/tailoring-cve-2019-2215-to-achieve-ro...


> Android 13+ includes a crosvm based virtulization setup

Interesting; but I feel that their choice of a hypervisor-based design here supports my point of plain container-based isolation (or even containers + gVisor) being insufficient to achieve true sandboxing on Android.

> Android's sandboxing is not limited to ART and has multiple layers [0]. Native apps cannot bypass sandboxing, I don't think.

Yes, but when I say "sandboxing", I mean just the ART sandbox, not the other layers. I don't care whether you can get root / jailbreak the device. I (and presumably Google, in not publishing apps that do this in the Play Store) care about whether an application that, upon installation, doesn't request permission to e.g. read your contacts, can actually read your contacts. There are certain capabilities like that (not sure if "reading your contacts" is one of them, but you get the idea), that are only prevented from being accessed by ART, not by Linux ACLs. This is especially true when there's one level of permission that gets you access to a certain database file through an API, but then another level of permission that gets you access to certain special records in that database file through the same API. The lower level of permission is already granting you Linux filesystem ACLs to the database file; the only difference between the two permissions comes down to what ART will allow you to request through the higher-level API.


It is prevented by killing any process that makes API calls not part of the official set of public NDK APIs and file locations.

Which is one of the reasons why Termux has issues on modern Android versions.

https://github.com/termux/termux-packages/wiki/Termux-and-An...


> It is prevented by killing any process that makes API calls not part of the official set of public NDK APIs and file locations.

This is not something Android does.


How much Android experience do you happen to have actually?

"Starting in Android 7.0, the system prevents apps from dynamically linking against non-NDK libraries, which may cause your app to crash. This change in behavior aims to create a consistent app experience across platform updates and different devices. Even though your code might not be linking against private libraries, it's possible that a third-party static library in your app could be doing so. Therefore, all developers should check to make sure that their apps do not crash on devices running Android 7.0. If your app uses native code, you should only be using public NDK APIs."

-- https://developer.android.com/about/versions/nougat/android-...

"Improving Stability with Private C/C++ Symbol Restrictions in Android N"

-- https://android-developers.googleblog.com/2016/06/improving-...

"Namespaces for Native Libraries"

-- https://source.android.com/docs/core/permissions/namespaces_...


I work on Android. Opinions my own, etc.

The things you’ve linked are attempts to discourage people from depending on private implementation details. They are not a security boundary, nor are they really the kinds of APIs we’re talking about in this context. Since they run in your process there is no sandboxing or isolation involved here; you can call them if you really want to by looking them up manually. (Don’t do this.)


Google does, in fact publish apps that require root access in the play store. Titanium Backup is a popular example (though I'd recommend the open source Neo Backup instead).

They presumably don't publish apps that use exploits to help the user gain root without unlocking the bootloader and wiping the data partition.


Now thats an app I miss using, but unfortunately its much harder to get root on phones now, or if you do a lot of functions like banking apps will not work.

Androids built in app backup functions are woefully incomplete, and switching to a new phone recently I had to relogin to most apps and re-set up nearly everything, except for stuff like contacts and anything from google. At least some apps supported exporting settings to external files and allowed re-importing them.


It's rare I run into an app I want to use that has more than trivial root detection, including my two banks. I would probably change banks before giving up root or mobile banking.

When I do run into apps that are difficult to run, I make sure to give them 1-star reviews. I consider attempts to block rooted devices from running an app to be malware.


There are many file explorer apps ( MiXplorer is my favorite https://play.google.com/store/apps/details?id=com.mixplorer.... ) on Google Play that have optional root access as well. You can use it w/o root, but if you have root it prompts for elevation and then lets you use it.


I also use MiXplorer, and wouldn't be able to read my camera's SD cards on my phone without it because Android doesn't support exfat for some reason. Root is required for it to use its own filesystem drivers of course.

I don't think I knew it was on the Play store. It's a free download from the website, but paid on the Play store. I'd like to make a donation without giving Google a cut - the author deserves to get paid.


> The lower level of permission is already granting you Linux filesystem ACLs to the database file; the only difference between the two permissions comes down to what ART will allow you to request through the higher-level API.

I get what you're trying to say, but perhaps you mean the ContextManager / ServiceManager, which isn't tied to ART at all, but Binder (Android's primary IPC mechanism), instead.

Re: Linux ACLs: Yes, those flaws existed, but don't think they do anymore (see also the blog I linked above).


No. Android will not grant you direct access to databases, for exactly the reason you’ve mentioned.


If it works like crosvm on ChromeOS, you can launch a KVM virtual machine and then run containers inside that. It even supports nested virtualization (at least it does on my framework Chromebook) so you can then run vms inside the VM for stuff like multipass or gnome-boxes. It actually works really. Would be amazing if this same pattern is enabled for Android devices with proper vmx/vt extensions on the CPU.


This is not how sandboxing works on Android: it’s SELinux -based. The Linux ABI is explicitly supported by Android, though generally not recommended.


> But I am concerned about the direction Android is headed,

Over securing systems seems to be the modern trend, and mercy, it's such suffocating paternalism.

We have incredible phones and Android/Google just keeps making them less and less capable.


I'm sure security is part of the reason for the ever increasing locking-down of android ... but I'm more sure it's an excuse and that security FROM the user is a huge factor in google's thinking.


I agree & I don't.

I'm sure that being an app store owner exposes you to the absolute worst just most constant stream of really really awful people doing the worst things, like, forever & ever.

There are some warped incentives too, for sure. But I do think Occam's razor explains why app stores get to be worse & worse & worse: because they are responding to horrors.

I'd love to see some better mechanisms for trust emerge. Software as it is is basically unobservable. You grant or don't grant some permissions & otherwise have no idea what's actually happening. So app stores are the only arbiters of trust.


You have to weight the aggressive security posture against the fact that there are nearly 1.5 billion smart phones sold every year. [0]

In addition to having ridiculous computing power and storage capabilities, they carry microphones, cameras, WiFi, Bluetooth, NFC, lidar, radar...

If you can grasp not just the power of the device but the scale of its reach the only responsible and ethical action is to security harden it every chance you get as much as you can.

0: https://www.zippia.com/advice/us-smartphone-industry-statist...


I get it, but building a prison for computing is a horrible fate to trap us in. Bad use constantly being used to consign us all to worse & worse forms of computing is a godforsaken trend.


> Termux singlehandedly makes me feel like I'm living my childhood dream of having a full computer in my pocket

I still remember the first time I successfully SSHed to something from my Handspring Treo 180 over GPRS data, and felt like I was living in some kind of cyberpunk future.


> But I am concerned about the direction Android is headed

I'm with you, but we'll always have AOSP. And the cellphone market is now segmented enough that we'll probably also always have rootable phones.


One of the most unfortunate things in the US is locked bootloaders. AT&T has even started whitelisting phones for Wifi Calling and VoLTE. And with 3g shutting down, it means international phone variants won't work at all on the network, regardless of the underlying band support. Many companies, including Samsung don't allow you to unlock your bootloader to root your phone even if you bought it outright. I found that midrange phones are now the best option if you want things like AOSP. The only true flagship left, that I know of, with a headphone jack and sd card and good rooting support is the Sony Xperia phones.


We'll always have the versions of AOSP Google has released, but they're not forced to do so in the future. And I'm not sure anyone else is interested in maintaining it.


Google only releases AOSP for Pixel devices, for most devices you need to rely on (and trust) some dude on a forum and it might not have 100% compatibility.


Isn't Fuchsia google's attempt to move phone off open systems, and onto all-google-no-license code? If it becomes a big thing, then only increasingly obsolete open-systems for us :(


Fuchsia is about as open as Android is today.


Thanks - there was talk when Fuschia first became visible that it was to be locked down. The project site does not agree with that.


Whether it is “locked down” depends on your opinion of what Android is currently, I guess.


Ironically, I specifically have a Google Pixel so that I can mod it and gain more control over my phone.


What are some examples of these types of mods?


Custom ROMs? GrapheneOS or LineageOS come to mind.


is anybody outside of google able to maintain aosp though


Why would I want to install termux? You basically need a keyboard to use it; at which point you might as well grab a laptop.


I mainly use termux for the script API (which is incredible btw). I usually write the scripts in bash or ruby on my computer and scp them over, but I also have a small keyboard that I can plug in to type directly on the phone.

Even if you don't use the CLI part of Termux often, it's still an incredibly neat piece of hackery goodness. I once needed to text about 50 people and have it be from my real phone number. Rather than hack around with Twilio or AWS, I spent 5 minutes writing a ruby script to send the texts from Termux. If you aren't familiar yet with the API, it will take a little longer than 5 mins the first time. Once I had that script, I kept finding neat usecases for it. I sometimes still just text from the CLI because it's easier than using the built-in messages app depending on what I'm doing.

You can definitely get an amazing experience on Android without Termux, but Termux is like if Android were a really nice bicycle, Termux is a small powered motor you can bolt on somewhere to automate parts of your life.

Aside: I find Termux easier to use than Tasker. I'm a CLI native old man though, so don't take this as a knock against Tasker.


I had no idea Termux had access to APIs that allowed you to do that, this changes a lot.


You really don't need a keyboard, I use it just fine with onscreen and even wrote some simple scripts in vim with it. Tab completion in the shell helps a lot too and termux's keyboard has a button for it right there.

But if you _do_ need a keyboard... it's android and it perfectly supports USB or Bluetooth input devices including mice, keyboards, etc. If you have a Samsung or some other devices you can even get a nice HDMI output to a monitor and desktop experience out of the box. It's really like a little laptop in your pocket at all times.

And if you need a GUI Termux runs X11, vnc, etc and GUI apps just fine. Just download a X11 server or vnc app from the play store (there are tons) and you're good to go.


You do not! You can use volume down as a Ctrl key, and volume up also unlocks other keys (volume up + wasd for example gives you arrows.) It also gives you an extra row above the touch keyboard with escape, tab, and some other keys, and a text input for pasting/IME/swiping/etc.

And even if that sounds uncomfortable there's still plenty of useful things you can do with minimal typing! For example... You could run Tailscale as a normal Android app, then use SSH forwarding in Termux to get a local port that goes to a web server on another computer in your tailnet, and browse to that locally on the phone using Fennec F-Droid (Firefox). All of that works just fine. If I leave one of my computers on and I'm in bed or away from home I can ssh in and run systemctl suspend. Wayland/X server locked up? You can use your magic sysrq keys of course, OR you can ssh in with termux and kill it, which doesn't depend on magic sysrq being enabled (or remembering how to get it on your keyboard.) You could also run yt-dlp to download some video or audio content from the internet; everyone hates the Reddit video player, so why not just get the MP4 out of it? Admittedly, there's a better solution here: you can get an app called Seal on F-Droid which is a pretty good yt-dlp frontend. But, the fact that you can easily do it in Termux using their package manager is testament to just how useful Termux is.

I honestly only want one thing; an SSH Agent implementation built into the app, so I can import SSH keys and not have to enter the passphrase constantly. Not a huge deal really, but having a built-in agent would be super convenient.


Take a look at https://github.com/aeolwyr/tergent

tergent is a ssh agent for termux that uses the Android keystore, meaning your private keys are kept in your phone's secure enclave for a bit of nice extra security.


Termux allows the same kind of scripting ability you would expect from a desktop. Termux-api almost rivals tasker in what you can automate with it. I use the "share with termux" function and git pull/push shortcuts more than anything else, and they are both effectively 1 touch functions. The share with termux function allows you to script how termux will respond to shared urls, I have it set up to auto-start yt-dlp and fill in certain formats and details and starts downloading. It was a little bit inconvenient to set up, but I managed without a fullsized keyboard. There's an app called hacker keyboard that makes it easy.

The original script I wrote was initially set up with youtube-dl, the most recent change was to yt-dlp. For a lot of little things, like to SSH/reboot my rpi, wget a link I want to archive/send, small python programs (and yt-dlp), the keyboard is perfectly adequate. I've even converted a couple of audio files to send to a friend on iOS, from opus to mp3 on the phone. Bash alias are really useful, and because the phone isn't also general use, they can be very specific.

Termux also makes the phone into a very powerful network diagnostics and pen testing tool. But even something as basic as ifconfig makes my phone feel as powerful as a computer. https://github.com/may215/awesome-termux-hacking

Chromebooks have the ability to install and run android apps. The lightweight environment afforded by Termux is perfect for them. I do use VIM with my chromebook. I know I can use crostini, and in the past I was running crouton, but I realized I can handle 99% of those things in termux, and I can use VSCODE dev for the remaining 1%. I appreciate how much more flexibility termux gives me.

https://wiki.termux.com/wiki/Termux:API

https://github.com/klausw/hackerskeyboard


You don't. I almost always use termux with virtual keyboard and it feels fine for doing something quick and on the go. Modal UIs (like vim) work better than modifier- and functional keys-heavy though.


There is quite a difference in size there! Find me a 7 inch laptop with phone battery life and pocket availabilty.


The closest option is probably the GPD MicroPC. It's 6", but pretty damn close to the ideal of a truly tiny PC. I think they're making a successor to this finally, dunno what the status is.

https://www.gpd.hk/gpdmicropc


Thanks for the link. It looks pretty cool. Form fact wise it looks to be competitive with an Android phone and a portable keyboard. So it's not clear immediately which is better.

I use termux daily, and you can stand up pretty much anything including a production grade PostgresDB. It's not a toy.


As an ex Psion 5 user, I've often been tempted by the devices from Planet Computers: https://store.planetcom.co.uk/products/gemini-pda-1


The keyboards on them are excellent, but the software/firmware stories for their devices are awful. Frozen kernels due to proprietary blobs, and support for running full Linux distros is limited and lags by months to years. And they're expensive as hell.

But they keyboards are good enough that I'd still kinda like to try the Astro Slide 5G. I just don't want to order one only to wait years for it to arrive.


As an owner of Cosmo, I can confirm all of the above. The form factor is great and the keyboard is amazing, but the software story kills it all dead in the water. I wish someone could just do a dedicated Linux machine like that.


In a pinch I've used it to ssh onto a box to fix something. I also have a script that backs up a few folders from the phone to a NAS using rsync.


You can SSH to your phone and rnu tmux and ffmpeg on it, which is more powerful than my netbook.


It has additional keys above the standard keyboard for tabs, Ctrl, arrow keys etc. It also has good scroll support, even in vim. Definitely fine for quick jobs.


Because I don't want or can't use my shitty corporate issued laptop to access my personal projects from work.


Some phone models supports docking. So you can attach screen, keyboard, etc


Install Hacker's Keyboard from Google Play or F-Droid.


It's hostile that Android doesn't let you modify things like the host file. It's running Linux but it feels like it's not your device.


> I have ffmpeg and yt-dlp installed to download videos for when I am going to be away from internet access for a while

Have you tried NewPipe for that use case?


Yt-dlp exposes all of the codecs, I think I remember newpipe hiding some options when I last used it. I struggled to find how to download just the ~140k opus audio (-f251) or maybe the combination audio+video I wanted wasn't there. I'm sure things have changed since the last time I checked.

But Yt-dlp is still more powerful, it has extractors for way more sites. If I download a video, I usually care to archive it for a longer term, so I add things like subtitles and metadata. For opus files, I don't like the webm container, so I would end up installing ffmpeg for that anyway. I also make heavy use of the regular youtube app, I appreciate the interface. Although I haven't had the need, Termux + yt-dlp also allows using aria2c for downloading. And yt-dlp has also been useful in bandwidth starved situations, because the url and format flags are enough to get the video, it doesn't hang while waiting to download related/recommended video metadata.


FWIW I ran into the "To protect your privacy..." thing when using Syncthing. I was able to manually specify the path to one of those "protected" folders in the text input. It worked. Might be just the native file picker that's protecting users from granting access to folders albeit in a very shallow manner.


The restrictions are regarding specifying the root folders, /emulated/0 and /sdcard as well as android/data and /obb folders. You are able to pick folders, other than data and obb, manually one by one but that would be over a hundred folders on my sdcard to use a gallery app. The /data and /obb folders are inaccessible to users even though it's in user space. As of android 13, third party apps can't open /data or /obb, you have to install an app that creates a shortcut to the hidden AOSP files app and drag/drop manually. Rooting/usb gives you access, but play store guidelines about android app api targets make things difficult for third party apps.

By "protecting" users from security threats, they are pushing power users to daily drive a rooted device, which is a bigger security risk. I expect incomplete/broken file storage access from Apple devices, not Androids.

The thing I hate the most is that certain apps only store files in their respective android/data/ folder and delete that data on uninstall. These workarounds are the only way to backup that data.

https://www.reddit.com/r/Android/comments/j3zgmm/managing_fi...


> feel like I'm living my childhood dream of having a full computer in my pocket

While Android can provide such feel, GNU/Linux smartphones (Librem 5 and Pinephone) are such computers. And they do not depend on Google in any way. (I'm a happy owner of both.)


I understand the sentiment, but I disagree. From the last time I checked, the big compromise with GNU/Linux phones is still the lack of social media and messaging apps and appstore ecosystem. Android, with root, is every bit as much a computer as a Pinephone and Librem 5, but the opposite isn't true. Termux has PRoot, a user-space implementation of chroot allowing a full distro install. I personally don't have any problem depending on Google, I have a problem with things being locked away with no alternative. Given the option, I will happily accept the risks and void my warray to root.

https://wiki.termux.com/wiki/PRoot


> Android, with root, is every bit as much a computer

Can you install a completely different OS on your Android phone? AFAIK no, whereas on Pinephone you can choose among 15+ systems and on Librem 5 currently among 4 or more. What about installing a mainline kernel?

> lack of social media and messaging apps

You can use Waydroid for Android apps, or install one of a few Matrix and Mastodon clients. Telegram works, too. Also, Flatpak apps work natively.

> I personally don't have any problem depending on Google, I have a problem with things being locked away with no alternative

To me these sound like the same problem. Google is restricting your freedom, not someone else.


I think we fundamentally value different things from our mobile devices. Waydroid is a low level compatiblity layer, but that's still not native and not guaranteed compatibility. I want all social media apps to work, I don't want to ask others to change apps.

If you want full freedom from google, GrapheneOS feels like the best de-googled solution. In some ways, PRoot is to android what waydroid is to linux, except PRoot is way more capable. Google free AOSP, like GrapheneOS exists so it's not fair to say it's the same problem. I appreciate having access to things like Kali NetHunter and value that over being able to install and run a mainline kernel on bare hardware. I don't see a difference in installing a completely different OS vs PRoot, because I am focused on the functionality. I wouldn't be able to tell you a meaningful difference in function between iperf3 running on a Librem phone vs native termux vs PRoot.

Here's someone that's installed Termux on waydroid, installed on manjaro installed in Termux on an android phone. https://www.reddit.com/r/termux/comments/y0kupg/termux_on_ma...

https://github.com/termux/proot-distro


> Can you install a completely different OS on your Android phone?

You could in 2012, not sure about in 2023:

https://bonedaddy.net/pabs3/log/2012/12/03/debian-mobile/

> What about installing a mainline kernel?

I think Sony were working on that for their Xperia devices:

https://developer.sony.com/develop/open-devices/guides/kerne...


You should check out GrapheneOS as an alternative to regular Android.


I hadn't checked out GrapheneOS in a while. Based on the current trajectory, in a few years it might become more practical to add play services back into GrapheneOS rather than continue to fight Google's android releases. I have been doing the worst alternative possible, refusing to upgrade. I was even considering of upgrading to an older flagship. I require a phone with a microsd card and headphone jack on my phone, so that rules out a new GrapheneOS device for now, but I hope that changes.


I'm not sure I totally understand your Google Play Services comment but they do allow you to enable it and it's "sandboxed" whatever that means. Do you have specific gripes about their implementation?


They can switch to provide an UNIX like experience rewritten in Java/Kotlin instead, CLI and stuff, their option.

Google has been quite clear since NDK was introduced in Android 2.0, that is only for games and native methods implementations.


I felt the same way when I got my Nokia N900 back in the day


The Nokia n900 still seems almost mythical to me, because it has an fm transmitter. The galaxy note with an ir transmitter is a close second.


ok this is a really cool idea.


Because it wasn't obvious to me for a while: the Play store version is old, basically broken, and vulnerable [0]. Don't install it. The description does mention this relatively high up, but do you really read through the description for something before installing and playing around with it, especially if you already know what it is?

I don't usually like having old versions of software removed from distribution, but maybe in this case it should be removed from the play store since it's basically useless and also vulnerable.

[0]: https://termux.dev/en/posts/general/2022/02/15/termux-apps-v...


Thanks for posting this. I don't know how difficult it is to get an app removed from the Play Store - but hope it can be done soon.

From README - "There are plans for unpublishing the Termux app and all its plugins on Play Store soon so that new users cannot install it and for disabling the Termux apps with updates so that existing users cannot continue using outdated versions. You are encouraged to move to F-Droid or GitHub builds as soon as possible."

Vulnerability Disclosure was made on 2/15/2022 [0]. Above text was added to README.md in 9/8/2021 commit [1]. The issue was first acknowledged in README in 4/26/2021 commit [2].

[0]: https://github.com/termux/termux-app/issues/2595

[1]: https://github.com/termux/termux-app/commit/94e01d68d6c91574...

[2]: https://github.com/termux/termux-app/commit/93e1b132786d5cc7...


I check out Hacker News everyday but this is my first post. I had never been a person who likes computers until the COVID lockdowns began. Some day I opened a Python course advertisement, I started the course but I got no computer to code the exercises, so I installed Termux on my 80$ Android phone and bought a 7$ external keyboard in order to do the Python exercises. Since then I have read several books about Linux and programming and bought my first laptop in order to continue with my self-taugh programming journey, all thanks to Termux.

Disclaimer: I'm not a native English speaker, so please forgive any mistake.


That remind me when I wanted to develop mobile apps. I had a jailbroken iPhone and there was this little IDE that allowed you to write Objective-C and get a UI up for your program. I did not have an external keyboard but you could transfer files via SFTP. Fun times. Now I have lots of compute power and can barely muster the energy to program anything


I enjoyed reading about how you started learning to program Python on an Android phone using Termux. What a unique way to get into computers! I wish you a fun journey of discovery and creativity.


Thanks, last week I wrote my first (very simple) recursive descent parser in Rust, for a little program to help my son with his math homework (combined operations). Always looking for personal uses for what I learn everyday.


That's wonderful!

Congratulations and good luck on your further journey! Keep having fun!


Thanks!


The Only App Which Does Not Specifically and Precisely Suck[tm].

I don't know whether I should be grateful to Termux for making Android remotely bearable, or vexed that it's enabling a platform I despise.

But on its own merits, Termux is amazing, profoundly useful, powerful, and a breath of fresh air.

Do install from F-Droid, not Google Play Store, as others note.

And yes, of course it's more useful with an actual hardware keyboard (Bluetooth), as is Android generally. But it's usable and useful even when using the onscreen soft keyboard. (Hacker's Keyboard FTFW.)

You can also run the available sshd service and access your mobile device remotely.

And yes, I mention and advocate Termux frequently on HN: <https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...>


> vexed that it's enabling a platform I despise.

Do you despise Android? How come? What's your preferred alternative?


Answering your first: absolutely, and suprised anyone need ask.

It's a Trojan horse serving manipulation, advertising, surveillance, and propaganda. It's also intentionally crippled in numerous ways. The applications-store model is horrendously broken from not only this perspective, but in terms of utility, quality, and trust.

Alternatives:

For mobile compute: a Linux laptop. An ultralight sacrifices some features, but at least delivers the full software-based capabilities.

An alternative might be a set of separate components which could be used standalone or together: a CPU, additional storage, networking (WiFi / Wireless), power (battery / PSU), display, keyboard. A mobile device similar to a smartphone or keyboard-equipped device (think RIM, Palm Treo) might make a useful casual interface to the broader system, speaking to the hardware attributes rather than the OS / SW necessarily. More: <https://news.ycombinator.com/item?id=33014529>

For a phone: none at all, or a dumbphone / limited-feature phone. The main dissuasion here is actually PSTN (public-switched telephone networks), which are increasingly obsolete under an onslaught of spam calls, as well as, increasingly, the deepfakes threat. VOIP over the laptop (using an unlisted wireless hotspot where necessary, otherwise WiFi or cabled ethernet) would suffice for nearly all usage.

Other than as an e-reader or podcast device, tablets are a worst-of-all-worlds compromise. See: <https://diaspora.glasswings.com/posts/880e5c403edb013918e100...> particularly the comparison table in this comment: <https://diaspora.glasswings.com/posts/880e5c403edb013918e100...>. That post and thread address most concerns and considerations.

For photos, video, or audio, a dedicated device seems to me the preferred option. I'm well aware the market is largely seeing otherwise, though professional still/video cameras (often the same device now), and audio recorders remain viable. Having to intentionally transfer content is to me a positive.

An e-ink tablet is a game-changer for reading content, and is quite good for listening to podcasts. I've owned one for over two years, large format (13"), and find it ... useful, though again with some limitations. I'd most especially like to boost onboard storage from 64 GB to 512 GB -- 1 TB (Apple's iPads offer as much or more as an option). More: <https://news.ycombinator.com/item?id=35280532>, <https://news.ycombinator.com/item?id=31412042>, <https://news.ycombinator.com/item?id=29236211>, and <https://news.ycombinator.com/item?id=29303195>. There are additional comments available via search: <https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...>

I'd strongly suggest that an 8" device is a minimum size I'd consider and that there are immense readability improvements at 10" and 13". (Devices rely on the same OEM vendor, so form-factor and display characteristics are strongly standardised and uniform, at least within a given production cycle.)

I've discussed Android and its limitations numerous times on HN:

"I certainly don't trust the OS or its application ecosystem..." (Nov. 2021) <https://news.ycombinator.com/item?id=29306994>

"Tablets --- and not just Apple's --- suffer from numerous arbitrarily-imposed limitations..." (Nov. 2021) <https://news.ycombinator.com/item?id=25220885>

"Tablets offer a near-ideal form-factor, and impressively good battery life. The story from there is exceedingly poor, and remains so..." (Jan. 2020) <https://news.ycombinator.com/item?id=22089820>

Issues with devices which were presumed rootable (proved otherwise) and unsupported with firmware updates: <https://news.ycombinator.com/item?id=21055547> and <https://news.ycombinator.com/item?id=20416488>

Issues with Google Play Store: "At what point does a competitive applications marketplace backfire in encouraging, intentionally or otherwise, Very Bad Behaviour?" <https://news.ycombinator.com/item?id=29236211>

I've watched the alternative-OS tablet space for well over a decade, and there's been vanishingly little to get excited about. Several e-book readers are based on non-Android Linux (Barnes & Nobel's Nook, Kobo Reader, the Remarkable Tablet, and some Sony models AFAIA). Remarkable was on my purchase-candidate list but left it pre-purchase due to the miserly on-board storage (16 GB), and post-purchase by its pivot to a subscription model. Nook or Kobo might be interesting, I've not played with them. Mozilla and Ubuntu have both killed their tablet-OS. Pine and Purism remain interesting but not yet compelling, again, I've not tried these directly.


> I've watched the alternative-OS tablet space for well over a decade, and there's been vanishingly little to get excited about.

GrapheneOS got me pretty excited. I actually bought a Pixel because of it.

There's also postmarketOS. I'll try to port it to my current phone once I have my new one set up.


Anything Android-based is going to fundamentally disappoint me, though de-Googled Android beats Google-infested. See criticisms above and in linked comments. That would argue against GrapheneOS.

PostmarketOS might be worth a look, thanks for reminding me about it.

Among the other problems Android presents is that it's very nearly totally owned the mobile-device market, save iOS and a very few niche products (e.g., the listed non-Android e-book readers above).

Otherwise in the small-device space there's RaPi and Arduino, and perhaps OpenWRT. Those obviously target different use-cases, but in terms of small/light systems are the principle options of which I'm aware. I'm also painfully aware that there are considerable UI/UX, power management, and security issues to consider for a mobile device, all the more so for anything that's aimed at a mass market. To an extent I can sympathize with some of the decisions Android's made, though that doesn't reduce my own frustration with it at all.

What I find curious about my own psychology and attitude toward the space is that the far more limited Palm devices (I'd owned a couple of PDAs as well as one of the Treo-line phones) didn't bother me to the same degree. Part of it was that these were such obviously limited devices, though they also seemed to be less afflicted by the advertising-and-surveillance disease.

Apple's iPads are so very nearly laptop-replacements but crippled in critical ways that it pains me. There's the Windows Surface (nice form-factor, pity about the OS), and a few other options.


That's a lot of words to say there's no real alternative if one wants a pocket sized device with an ssh client and a good cellular data connection.

I get your point. It sucks that these are our options, but you didn't present any viable alternatives.


Answers to questions often surprise or disappoint.

Those are often the most useful answers.


Sounds like what Richard Stallman would say.

I'm going to pass.


The combination of termux and scrcpy is pretty cool. Scrcpy is currently being discussed as well: https://news.ycombinator.com/item?id=35749366

I have one of those Bluetooth keyboards and mice that allow multiple paired devices. There's a button on each to allow you to switch. That's pretty handy to have it paired with my old Android device and be able to pop over and use my tmux sessions.


Oh dude! That's such a great idea. So great that (like most great ideas) it's extremely obvious in hindsight and I feel silly for not having considered it :-D


Humm, I am not getting it. Can you detail the setup you envision? Thanks!


This is on the top 5 list of my favorite android apps, every time such question comes up in a forum. I complement such with what I install under it (e.g. nmap, wget, curl, dns tools, various network utilities, whois, openssh, etc.)


Would love to know what your other 4 are.


Termux is great.

One of my favorite tricks is sharing a photo to it, then running a quick `python -m http.server 8000` while on wifi. It makes it dirt simple to send a photo from my phone to any local machine on my network without the hassle of cloud services (including generation loss from recompression), incompatible apps, bluetooth pairing, etc.


Just use https://wormhole.app - it is end to end encrypted, privacy preserving and network friendly.


kdeconnect is great for this too!


Do you or anyone else know what the state of kdeconnect is on gnome? Last I tried it out it didn't work super well and the functionality was spread out among a handful of different apps. If you didn't already know what you were looking for, it was very difficult to discover what you can do.


https://extensions.gnome.org/extension/1319/gsconnect/

It works as it should. I use two machines, one with KDE Neon, one with Gnome Fedora, and all my Android devices works great with both.


KDE Connect is a standalone multi platform application, you don't have to run KDE to use it (I don't).

Installing the gnome alternative was one package and I killed X and started gnome-shell to test gsconnect it appears to pair and allow remote input from my phone to my PC and well enough, what doesn't work for you?


Look up Syncthing. I have it running on my phone and computer and I have near real-time updates of the gallery. I can even delete and add photos from PC to phone. (It's not limited to the gallery of course)


I update my website by writing it in the Squircle CE editor and then run my static sitegenerator, commit and push to the server by pressing a termux homescreen shortcut. Works great. Images are a bit of an issue, but I have another termux script that's run when use the android "open with" menu and select termux on an image.

If anyone has a better idea how I can get images into the filesystem from an editor in android, let me know.

PS: Some light ChatGPT copy paste coding also works great. My foldable keyboard mouse setup means I could code everywhere.


You can use any file browser that supports android's document api to browse termux's filesystem. If you are using something like samsung oneui it can't do that, but you can install Anemo and use its shortcut to open android's default "Files" instead of samsung's


(Termux will appear on the left side bar beside "Internal memory", sd cards and google drive)


I can highly recommend it. Also, it's worth using f-droid to install because otherwise you can't get the latest version.

Until I discovered termux, I would have always be on the lookout for new git client / ssh client apps. Now I have a fairly good dev env on my phone. Git and vim get me pretty far in that regard. Python and node were easy enough to set up. Recently, I set up nvim so I can use GitHub Copilot and I think it's particularly helpful on mobile.

Most of my personal projects run in containers. I know it is possible to get docker set up on Android. However, it is apparently pretty slow and it doesn't look totally straightforward to get working so I haven't tried that yet.

A few years time and hopefully I'll be running docker containers and maybe VS code will become a solid option on mobile too.


As an aside, vim on Termux is not nearly as difficult/awkward as one might think. Of course you can plug in a keyboard to the USB port wired/wireless with dongle or via bluetooth, but even without it I find vim's modal editing with a focus on keystroke golf (e.g. fewest keystrokes possible) to be a boon for finger-pecking out on a soft keyboard. For doubters, don't knock it til you try it!


I like Termux, but most of the time I use a real PC, because of the better UX. However, together with Samsung Dex most of the usability problems disappear and you can use your phone as a work station.

Sometimes when I don't want to start a PC I just connect my phone to my USB-C docking station and Termux has most of the tools that I need to get something done.


Termux is one of my favorite mobile app. Especially because I can run basically whatever I want to it as long as it's in text mode. X11 support is there but honestly that too janky for me and I'm more comfortable with cli any ways. There are some bonkers things we can do with this. Like running dwarf fortress on it[1]. My favorite thing is running Julia+Pluto so I can do stupid toys on it.

I sometimes wonder what kind of stress I'm putting on my phone by doing this.

[1] https://www.reddit.com/r/dwarffortress/comments/r80m7y/dwarf...


I’ve put this on a 20$ android phone that I got on eBay and was so impressed it made me consider switching from iOS to android.


That's the neat part about this. Need a Linuxy ARM SBC to run python, or a tiny web server, or home automation hub or something like that but Raspberry PIs are unavailable or overpriced in your area and alternative products are too sketchy and unsupported? No problemo.

Just get an old Android flagship off the second hand market that can be had dirt cheap, flash some FOSS de-Googled ROM on it, and use that instead. You now have the power of Linux and Android ecosystems for much less than a Pi and it comes with a display and battery! Need GPIO too? You can connect an external GPIO board via USB-OTG to the phone and control that via Python just like with a Raspberry PI.


For extra tricks (and challenges), buy an Android phone that can run postmarketOS, which is basically Alpine Linux. This comes with more up to date kernels (something older phones often lack) and can run things like Docker without too much trouble.

Most phones aren't fully supported but there are a bunch of phones with decent support and modern enough SoCs that can be had for cheap.

PmOS devices don't run Android so the Android HAL that custom ROMs often rely on isn't in use, which can lead to broken hardware support. On the other hand, many of these devices run a recent version of Linux so you can play around with all kinds of modern features.

https://wiki.postmarketos.org/wiki/Devices


So true. I use Termux, but I haven't used an Android phone to replace my embedded stuff. I have used tablets as interfaces to some of my projects. I have an old Keyone Blackberry I should try this with. The real keyboard may come in handy if the screen is acting up. Any recommendations for a FOSS de-Googled ROM? I've tried this in the past, but I have not kept up with them.

My needs sometimes call for more realtime control, and the system I ran in the past (Navigator) ran on QNX (owned by Blackberry) a microkernel OS (like Minix was, not Linux). Is there a close competitor in the Android world?


Used flagships have always worked well for me. They were built the best at the time whereas new budget phones have to cut corners. Phone tech is not changing that fast anymore.


How old/used is the price sweet spot? Have you gotten bad/broken devices? Where do you buy them to avoid people over-representing the status of the device?

I've got kids that are starting to need phones and this seems like a great way to do it.


Wow what a great idea. I currently use my Raspberry Pi to make OCI container build for ARM, but for some reason docker routinely breaks on raspbian. The most recent aggravating breakage is that the system clock always goes to Jan 1 1970 inside the container, and I can't figure out why (if anyone knows how to fix this, I'd be eternally grateful for a hint). Because of this I've scripted an ARM EC2 instance that spins up, builds the image, pushes it, and spins down, but I'd love to have a local solution on hardware I own. I'm gonna give this a try!


Story Time

I was an IT person for the math building while I was in college and I was mining a newish crypto called doggo on a computer lab while everyone was out for the summer. I had approval to do it and it was going to turn off as soon as the semester started back but they all had workstation cards and I couldn't resist. A man had offered to sell me a 99 civic if I got 200k and I needed a car.

Cut to weeks later and I'm hundreds of miles away for the day eating and drinking at a vitnamese restaurant with some friends and I get some notifications that the mining stopped.

I wasn't worried or afraid though because I knew in my pocket I could just pull out my android and click the magic button, Termux, to get a friendly and sensible shell with which to fix whatever mess had been thrown my way.

It was over in 5 minutes, I just rebooted them, process continued and I kept eating my noodles. Couldn't recommend it enough.

I had 300k by winter break and I had been set to meet the person for the civic after Christmas but that holiday a bunch of people's wallet got hacked and mine was no exception.

I ended up getting a card eventually but it wasn't the 99 civic -_-.

Termux on the other hand has been on every phone ive owned since


I sometimes run org mode in emacs under termux on my phone. After getting fed up with crap in simple list apps, my grocery list is a file in termux.


Emacs on Termux is great. I have used org mode, shell mode, magit (for git), and even eww (the Emacs Web Wowser) to great effect in it.


What software keyboard do you use? I find it dificult wothout ctrl and meta to type in emacs


Termux has its own keyboard that includes ctrl and escape. It's not nearly as nice as a REAL keyboard, but I'm usually just reading or editing a few lines at a time.

Dragging the finger up and down emulates the mouse wheel, do I don't even have to do ctrl-v.

I also use it with an android tablet that DOES have a real keyboard. It works fine, though I haven't figured out how to persistently swap ctrl and caps yet.


Moreover, the special extra Termux modifier keys are configurable in ~/.termux/termux.properties. I added Shift to them, because although there's a Shift key on Gboard, Shift-Enter is not treated the right way by org-mode if the Shift is from Gboard.

For some reason if you use the Thumb-key keyboard, every letter is capitalized by default, so you have to swipe down on the A before typing anything, which is a deal-breaker.


The Home Assistant built in grocery store list maker is amazing


Hmm... looked for it on melpa, but couldn't find it.


Folks who want a more traditional linux environment and libraries then what termux comes with might find proot-distro[1] to meet their needs. Basically it allows running an actual arm linux distro in a pseudo container created by (ab)using the ptrace syscall to emulate root privileges. This has a fairly big performance impact, but it works if you want to run arbitrary arm linux binaries.

[1] https://github.com/termux/proot-distro


Termux integrating the Python ecosystem [1] offers a glimpse of an alternative universe, where mobile devices are far more empowered.

[1] https://wiki.termux.com/wiki/Python


Pydroid exists and is a much better experience.


Related:

Termux on Android 5 or 6 - https://news.ycombinator.com/item?id=33691293 - Nov 2022 (119 comments)

Termux – An Android terminal emulator and Linux environment on your phone - https://news.ycombinator.com/item?id=32648424 - Aug 2022 (2 comments)

Why is the Play Store blocking updates for Termux but not UserLAnd? - https://news.ycombinator.com/item?id=28815910 - Oct 2021 (2 comments)

Termux no longer updated on Google Play - https://news.ycombinator.com/item?id=25644964 - Jan 2021 (340 comments)

Termux is an Android terminal emulator and Linux environment app with no rooting - https://news.ycombinator.com/item?id=24979258 - Nov 2020 (208 comments)

Termux and Android 10 - https://news.ycombinator.com/item?id=23224669 - May 2020 (314 comments)

Termux: terminal emulator and Debian-style userland as an Android app - https://news.ycombinator.com/item?id=15529426 - Oct 2017 (139 comments)

Termux: terminal emulator and Linux environment for Android - https://news.ycombinator.com/item?id=11570596 - April 2016 (5 comments)

Show HN: Termux – Terminal emulator and Unix environment for Android - https://news.ycombinator.com/item?id=9905391 - July 2015 (28 comments)


It is real comfy on e-ink android devices :3


Termux sent me down a rabbit hole of trying to figure out the cheapest computer that I could legitimately recommend to someone as a learning computer.

I found $18 Android phones on clearance at Walmart, like the TracFone - Alcatel One Touch Pixi Unite with 8GB Memory Prepaid Cell Phone - Black. I mean, look at the specs:

* 1500 mAh Battery, 800x480 screen

* Quad-core 1.3GHz processor with 1GB of RAM

* Android 6.0 Marshmallow OS

* 3G data speed for fast Web browsing and multimedia downloads

* 3.97" TFT color display

* 2.0MP camera

* 8GB internal memory plus microSD slot

* Expand storage up to 32GB by adding a microSD card (sold separately).

I mean, compare it to a Mac Classic - with this little infographic I made: https://i.imgur.com/7UJjRuc.png

You just would never use the data plan. On wifi, it worked great. So, go to a Starbucks, McDonalds, or Library... And you're coding in basically a real Linux for $18. (!)

This thing was particularly impressive, at $56.20, the RCA Voyager Pro 7 16GB Tablet with Keyboard Case Android 6.0 (Marshmallow) in Charcoal (RCT6873W42KC M). https://www.amazon.com/gp/product/B01M7TSY16

This $90 one seems like a reasonable alternative: RCA Atlas 10 Pro (RCT6B06P23H) 10 Inch Android 9 Tablet with Keyboard Black (Renewed). https://www.amazon.com/RCA-RCT6B06P23H-Android-Keyboard-Rene...

And then Chromebooks, of course. At the time I was loving my $169 Samsung Chromebook 3 with 4 GB of RAM from Best Buy. Termux runs great. Loved this machine - I used it all the time. I also played with GalliumOS, which requires "rooting" to Developer Mode. I have a Samsung 128GB USB Drive, and a 16 GB microSD card, and both seem to work. I use a mouse, sometimes. Android Apps were a little dodgy - the mouse turned into a black square, sometimes, for instance. And this was even before they offered a full Linux shell on Chrome! Now it's far easier, of course.


IMO it’s never worth buying these “cheap” devices new when you can find used devices with much better specs for similar prices on eBay, Swappa, Craigslist, Reddit, etc.


Sure, but I can recommend a cheap device to others. A room full of others. A classroom of others. Or in an online video or blog post.

Sure, if I'm doing bespoke computing for others, I can spend my time (which is really valuable to me, by the way) to find a good deal.

Or I can minimize my time, and still get a pretty remarkable machine for someone.


Termux basically replaced my laptop. Can't live without it anymore. I've written thousands of lines of code from within it. Many of my projects were born inside it. Nothing beats programming while lying down comfortably in bed. It's also a great way to pass the time during long flights.


I don't use android, but why not just install a custom android ROM (with root privileges)? Is it a hardware driver issue? Is it too much work to keep an android distribution up to date? ...like, does Samsung do any work to make sure it's difficult to use anything other than their pre-installed android?


Not all phones allow you to root, even if you paid outright for the device. Termux is different from a custom ROM, Termux gives you things like native nodejs, python, ffmpeg, git, and nmap. It's independent from the underlying OS. All phone come with a bootloader lock and only some companies allow you to unlock it. You need to do a bootloader and oem unlock in order to have the ability to root. Certain devices have sensors/parts that aren't supported via AOSP, back in the day I remember reading "not working: wifi" in the feature list for custom roms. I think wifi is usually okay now, but camera and cellular modem are still not guaranteed.


I could do that but I don't want to lose full compatibility granted by official ROM. I'm really happy with the stock one and want to just use my phone without screwing it up. So installing termux is pretty much the non-invasive option compared to a ROM switch.


Is there any sort of reputable, non-subscription (and open source, while I’m listing wishes) SSH client for iOS/iPhone?

I ran across Blink (which is subscription-only) and Prompt ($15—-not unreasonable if you’re sure you’ll use it often), but I’m curious to hear recommendations from here.


I'll add a-Shell to the chorus. Runs ssh, vim, python, and a host of other stuff too on iOS/iPadOS.

https://apps.apple.com/us/app/a-shell/id1473805438


WebSSH has been serving me well. It's simple and convenient.



Last time I tried ish it would freeze during any serious coding task. Can't remember if I was using an interpreted language or C.


Just yesterday I installed ConnectBot from F-Droid (free software) to access my laptop via SSH. It works just as fine as the other app. bought from the Play Store.


I can recommend "Prompt", works well, no issues.


I've given up on Android and smartphones ages ago. Today am a happy dumb phone user and intrigued only by the Pinetab 2, however I played with Termux on old devices and loved it; that was really close to having the real thing under the hood. Unfortunately my best tablet, a supposedly crappy no-name wifi-only one which was like a gift for buying something else but it's incredibly fast and much snappier than bigger ones, runs only Android 4.x (yeah, I know, that's pretty much retrocomputing:^) so it's not supported.


If you do like the nix ecosystem (and all its benefits like reproducible envs) or just want to give it a try to a "NixOS" like thingy, you should absolutely try https://github.com/t184256/nix-on-droid. It's somewhat rough, but it's very nice and has nix flakes and home-manager support.


I have used termux for to SSH to various boxen in a pinch, but I just recently realised it allows me to write and run arbitrary scripts on my phone!

I can basically do (limited -- but sufficient for my needs) Android programming without knowing a lick of Android. And I can do it on the phone itself. Crazy that I didn't realise this potential sooner.


Yes! For me the real power of Termux emerged when I discovered the API. tldr: most of the android API is accessible from within Termux, and since you can install nearly any interpreter/compiler you can write programs that target android APIs from nearly any language! I personally love using Ruby for this. It's a true automaters dream.


One of the reasons I like chatgpt is that it makes coding on phone much more accessible. Type a prompt and paste it into vim in termux.

Using scripts to edit and maintain your android internal file system is another plus. Unfortunately can't write to SD card if you're not rooted.


One of those things. It's on my phone for years, never used it, had to use it today. Now it's top on HN. Anyway. The reason I never use it dawned on me. I can't install an ssh client and I don't get their package manager for some reason.


>I can't install an ssh client

You can instal OpenSSH https://wiki.termux.com/wiki/Remote_Access

>I don't get their package manager for some reason

It's the same as Ubuntu/Debian


I have been using termux on my tablet for work and it runs very well; I had taken a screenshot some time ago for reddit:

https://i.redd.it/p5h7ongm51541.jpg


it's pretty sad to have such a powerful computers in our pockets and not being able to use as we want, even to be forced to discard them just because it wont get any updates.


Big Termux fan. From using my phone as a borg backup target (with Wireguard) to ssh access to remote servers, it gives you a full blown Linux environment in your pocket.


I loved using termux to run bits of my R code in it. With git and my text editor/IDE, it actually felt pretty good.

Sadly I can't seem to get R to work on it these days.


There's a fork of Termux that uses Nix for package management on F-Droid, and the R environment on it seems to work fine. Just tested it by booting up the REPL.

https://github.com/t184256/nix-on-droid


I love that someone here knows a work around for this! Thank you, giving it a try now. I keep hearing about Nix, but I feel like it is something I don't and won't fundamentally get the concept of. I put it in a box along with things like 'multiple dispatch' and 'immutable operating systems'.


Nix has a vast ecosystem and conceptually rich foundations, but it can also be useful without touching any of that. 'I just want to use this one program in this weird environment' is a totally reasonable use case for Nix, and that can be where you happily stay with it for years. I'm 'into' Nix now, but that's how it was for me for a long time, and using Nix at that level requires very little learning investment.

With Nix-on-Droid, I encourage you to:

  - enable flakes, because it makes some things easier and the evaluation caching speedup is critical on slow little ARM devices
  - run `nix registry pin nixpkgs` right away, then `nix search nixpkgs` to get the slow stuff out of the way
  - don't bother with Home Manager yet. It's good stuff, but your needs at this point are minimal and it's more to learn.
  - to quickly try out R, run `nix shell nixpkgs#R`! When that's done running, R will be on your PATH
Have fun! Feel free to keep it simple, but if you do have questions, regulars on discourse.nixos.org are super nice and super smart. :)


Ah thanks. Wish I'd seen this before I embarked on things! I muddled my way through doing things like:

nix-env -iA nixpkgs.rPackages.tidyr

This seemed to work fine for things like R and Vim and some dependencies, but didn't work so well for R packages which I think all needed to be compiled and installed from R.

I'm very pleased to have a working set up now, with neovim/nvimR/R/git etc. remarkably similar to my regular set up, so many thanks for these tips!


There are a ton of R packages in Nixpkgs already! To use them with R, you ask Nix to 'build' an R that has them available. This is the general pattern for all languages available in Nixpkgs, but the details vary between languages somewhat. You can find the guide for any/all of them in the Nixpkgs manual. Here is R's: https://nixos.org/manual/nixpkgs/stable/#r

I think not literally everything (especially if it has native extensions) is necessarily working, but everything in CRAN and Bioconductor is on there. Give your faves a try!

To explain this seemingly strange behavior a bit: because of Nix's commitment to isolating dependencies, when you install a language interpreter to some environment, it needs to behave the same way no matter what is installed in that environment— including packages from its own ecosystem. So instead, Nix has you be fully explicit ahead of time about what you want each language interpreter to pick up on, and those are the only in-ecosystem packages it'll ever be able to see.

This is super nice for per-project dependencies and for scripts that can bring along all their own dependencies, but it can seem a little weird when what you're used to and what you expect is just managing a single environment.


Ah ok, looks like I've been doing it wrong but that's great to know.

Reading around on Nix, I'm starting to wonder if I should use a functional package manager for a functional language...

One issue I've had with analysis projects is that when my R system upgrades I find old project code for previous analyses don't run anymore. Would Nix allow me to specify/run different R and R package versions for projects in different locations/folders?


> Would Nix allow me to specify/run different R and R package versions for projects in different locations/folders?

Yep! You can even easily integrate Nix with direnv so that it magically grabs the right tools and puts them on your path whenever you cd into the project directory. Many editors and IDEs also have plugins that integrate with direnv, so you can oftentimes get them to integrate with those runtimes even without starting them from the project directory.

Nix has pretty good support for this built in (shell.nix and flake.nix), but you'll probably find that some opinionated tooling is nicer for just jumping in. The Nix ecosystem is rich, divergent, and competitive, so there are often a lot of tools designed to leverage or enhance it all competing in a given single problem space. This can be overwhelming. Here's my recommendation for getting started with Nix for project environments today: https://devenv.sh/

It supports R, it's based on some of the nicest tools in the Nix ecosystem, it has great documentation overall (though incomplete), development is very active, and the author and maintainer is longtime contributor in the Nix community with a strong reputation (he served as NixOS release manager several times!). I've only taken it up recently myself, but I use it every day at work and I'm very happy with it.

Definitely go to NixOS Discourse or Matrix if you have questions and people can help point you to the best docs as you get acclimated.


I have been struggling with termux on Android 13 pixel 6 pro. Whenever I edit a picture with ffmpeg, it's invisible to the normal Photos app.


Termux uses a sandboxed file system by default, but you can give it access to the rest of the phone's shared files by running `termux-setup-storage` from within Termux (more details at: https://wiki.termux.com/wiki/Termux-setup-storage).

That'll mount a new folder called "storage" in your home directory where you can place files in locations where other apps can see them.


I have done that, the files are created in their normal locations where the rest of the photos are. But the files created by ffmpeg don't have the execute x permission bit set and I think because of that they're invisible in the photos app.


Forgive the possibly obvious question, but have you tried `chmod +x` ing the ffmpeg output files with termux?


Yes, it returns successfully but the x bit is not set


That doesn't work any more in modern Android, unless SAF is used for communication between applications to access private data.


Just last week I used Termux to rsync photos from a relative's old phone to a new phone, so useful!


It's unfortunate that due to a hardcoded prefix it is unusable in secondary Android profiles.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: