Live data from Hacker News

Termux is an Android terminal emulator and Linux environment app

termux.dev

171–174 of 174 posts

Re: Termux is an Android terminal emulator and Linux environment app

#171
post #170
post #162

Earlier quoted context omitted.

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…

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 regul…

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.

Re: Termux is an Android terminal emulator and Linux environment app

#172
post #171
post #170

Earlier quoted context omitted.

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 regul…

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 nat…

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?

Re: Termux is an Android terminal emulator and Linux environment app

#173
post #172
post #171

Earlier quoted context omitted.

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 nat…

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 diffe…

> 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.

Re: Termux is an Android terminal emulator and Linux environment app

#174

Earlier quoted context omitted.

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,…

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?
Post reply on HN