Nix-on-Droid solves a problem many developers encounter when trying to use powerful Linux tools on Android: how to run a full-featured package manager like Nix on a device without root access. Android’s locked-down environment typically prevents traditional Linux software installation. nix-on-droid circumvents this by combining a modified Termux app with proot, offering a real Nix experience on your phone.
what nix-on-droid does and how it’s built
At its core, nix-on-droid brings the Nix package manager—known for its declarative and reproducible software management—to Android devices without requiring root privileges. It does this by running Nix inside a proot environment, which simulates a chroot-like isolation without elevated permissions.
The project modifies Termux, a popular terminal emulator and Linux environment for Android, to better support Nix. Termux alone is limited by Android’s filesystem and permission model, but with proot, nix-on-droid creates an isolated environment where Nix can operate as if on a standard Linux system.
The stack is primarily Nix itself, running atop a proot-based environment inside Termux. This setup lets users install and manage thousands of packages from nixpkgs—the official Nix package collection—right on their Android device. The system supports declarative configuration through custom Nix files and integrates with home-manager, allowing users to manage their home directory environment declaratively.
While nix-on-droid currently targets aarch64 Android devices (the majority of modern phones), it is still labeled prototype-grade, so expect rough edges. It also offers experimental support for Nix flakes, a newer declarative mechanism for managing Nix configurations, which signals active development towards more modern Nix features.
architectural strengths and tradeoffs
The standout technical achievement is how nix-on-droid leverages proot to provide an isolated environment that mimics a traditional Linux filesystem and process space without root. This is clever because it bypasses Android’s security restrictions without compromising device integrity.
The modified Termux environment is opinionated but necessary to support Nix’s dependencies and filesystem expectations. The codebase includes patches and scripts to bootstrap Nix and manage the proot environment effectively. This approach keeps the footprint minimal and avoids the need for custom kernels or rooting.
Tradeoffs are clear: performance overhead is inherent due to proot’s user-space emulation of chroot. This means some operations will be slower than native Linux, and certain kernel features or low-level system calls are unavailable. Also, the prototype status means the installation and package management experience may lack polish or stability compared to desktop Nix.
Despite these limitations, the code quality is surprisingly clean. Configuration is kept declarative and extensible via Nix expressions, and integration with home-manager brings the powerful reproducible environment management Nix is known for. The adoption of flakes, even experimentally, shows forward-thinking design.
quick start
Install it from F-Droid, launch the app, press OK, expect many hundreds megabytes of downloads to happen.
This minimal quickstart highlights the straightforward user experience—no complex setup commands beyond installing and launching the app. The heavy lifting happens behind the scenes, downloading necessary binaries and setting up the environment.
verdict
nix-on-droid is a neat technical solution for developers who want to bring the power of Nix to their Android devices without rooting. It’s not a polished end-user product yet but offers a solid base for exploration, experimentation, and perhaps daily use if you accept some performance and stability tradeoffs.
The project is most relevant for Nix enthusiasts, developers who rely on reproducible environments, and anyone curious about running complex Linux tooling on Android. It’s a solid example of adapting desktop Linux tools to constrained mobile environments using proot and Termux.
If you want a rootless Nix environment on Android and are comfortable with a prototype-level tool, nix-on-droid is worth trying. Just keep in mind the overhead and the limited device architecture support at this stage. The codebase and design choices also provide valuable insights for anyone interested in cross-platform package management or environment isolation techniques on mobile.
{ config, pkgs, ... }:
{
home.packages = with pkgs; [ vim git ];
programs.home-manager.enable = true;
}
This snippet from typical nix-on-droid config shows how you can declaratively specify packages and enable home-manager, leveraging familiar Nix patterns even on Android.
Related Articles
- Hatchet: durable background task orchestration with Go and Postgres — Hatchet offers a durable, fault-tolerant background task and workflow engine built with Go and Postgres. It supports com
- OpenAI Codex CLI: local-first AI coding assistant with ChatGPT integration — OpenAI Codex CLI brings AI coding assistance local to your terminal, integrating with ChatGPT plans for powerful hybrid
→ GitHub Repo: nix-community/nix-on-droid ⭐ 2,015 · Nix