Nix-on-droid | A better Termux ?



Termux is an amazing Terminal emulator for android devices but, it lacks many packages that has been removed from Termux (Metasploit, THC-Hydra, John The Ripper, etc). But now we have an alternative to that which includes all these packages and works without root. So In this article we will talk about that.


So It is Nix-on-droid, It is a modified version of Termux especially for nix package manager. If you don't know anything about Nix, Its fine we don't even need that to get started with this.


Prerequisite

F-droid

Nix-on-droid (Get if from f-droid)


Basic setup


Once you installed Nix-on-droid, just open it And at first start it will install some packages and configure that, so just click on ok, and then it will prompt you to say y or n, just enter n there


And once the installation is finished, then first we need to install nano as we need to modify some files here, so execute following to install it


nix-env -iA nixpkgs.nano


Then just open configuration file


nano ~/.config/nixpkgs/nix-on-droid.nix


Here you need to uncomment the packages, listed there and if you want you can add more packages if you want.

Once you done that, then just save the file.


Now execute following,


nix-on-droid build


This will install all those packages that were listed in configuration file.


Basic commands


Next thing is how you can install packages here, So you can use following command to install packages


nix-env -iA nixpkgs.packagesname


In above command, you need to replace packagesname with the packages you want to install.


If you don't know the package name, you can search it here.


To remove a package, execute following


nix-env -e packagename


To upgrade a package


nix-env -u packagename


To upgrade all packages


nix-env -u


Nix generations


Now nix has something called generation we can be use to switch between those generations of something goes wrong, Basic there generation are created when you make some change like install or uninstall packages.


So to list all generations, execute


nix-env --list-generations


To go one generation back,


nix-env --rollback


To go to a specific generation, execute


nix-env --switch-generation generation_number


In above command, replace generation_number with the actual number, you will get that when you will list generations


In conclusion, nix-on-droid has packages that  is not available in Termux, so you can install and use that, but for other this, Termux is still best.


Post a Comment (0)
Previous Post Next Post