Skip to content

Android Server | Nix Flakes

🤯 Is that even a thing? I want it, give it to me now!

fry money gif

Android Server

Why? Why would you even? 😑

Ummm because it's fun lol

You can check out my post here where I setup a basic Android server that is truly headless 😂 stacked in the rack with ethernet and power.

Nix On Android

Nix-On-Droid is the Nix package manager on Android that has flake support baked in 🤤

I think you can all see where this is going? I have two racked, remotely accessible Google Pixel 5 phones with stable networking... ⚙️turn-turn ⚙️turn-turn 💡 We should deploy Nginx load balanced across the devices for funzies❗️

Goal

Android Server: - git pull my main Nix repo and deploy Android headless servers - Host the same website on both Nginx hosts and load balance it - HTTPS signed by a trusted CA - Make it public

Flakes

First step it to install git to pull down my actual code repo. The default flake command for nix-on-droid is nix-on-droid switch --flake path/to/flake.nix. Now that we have git, grab the default .config/nixpkgs/nix-on-droid.nix, any relevant files, and merge them into your current Nix flake setup. We can now apply changes with nix-on-droid switch --flake path/to/flake#device.