Introduction
Never have I expected this much friction and frustration when switching to NixOS as my daily driver for development work.
1. Only nodejs 18 and above are available on nixpkgs
I don’t get to choose what nodejs versions to use for work. For legacy projects I need nodejs 8, 14, 16 etc. The “oldest” compiled nodejs version available in nixpkgs is 18. I found Nix package versions but it requires compiling them from source. I can’t tell my boss “I’m compiling Nodejs 10 please wait 4 hours” before working on it. How I miss fnm.
2. Setting up Android and react-native for mobile development is an absolute nightmare
To be honest, setting it up on a normal Linux machine is not easy to begin with; but at least it was possible on Arch Linux. All I found is various forum blogs and people’s snippets. devenv comes close yet I still have not figured out making emulator and android studio works.
3. playwright
and prisma
binaries do not work
I understand running binaries don’t work, and playwright are available in nixpkgs, but I need playwright to be available in my reactjs projects. I got it working with playwright-web-flake but I have yet to figure out running Firefox and Webkit; I spent hours digging through various github issues.
4. Making Python packages run is not easy
Python package management is a mess: pip
, pipx
, pyenv
, poetry
, ux
etc. If the project is not available on nixpkgs, then good luck spending hours packaging it yourself.
It’s skill issue on my end
Someone with the skills will solve the above problems easily; probably with some overlays
or nixpkgs
libraries and pure functions or blah blah. I’m sure eventually I figure it out too. My point is, these are the situations I could never anticipate until I actually use NixOS for development. NixOS requires you to understand various languages’ package management, and the tools available in NixOS for them, e.g., uv2nix and buildGoModule.
Distrobox comes to the rescue
Distrobox solves so many problems for me that I can’t do development without it now.
distrobox create --name archlinux --image archlinux:latest --home /home/username/Machines/archlinux
distrobox enter archlinux
With these two lines and you are off to the races. No more figuring out what dependecies the Python package needs. It gives me the flexibility to run it now. If I want to I can package it later (umm yeah sure I will do it).
Yes but please, I just want it to work now.
I have the following essential packages for my new Arch Linux Distrobox:
1. paru
sudo pacman -S --needed base-devel
git clone https://aur.archlinux.org/paru.git
cd paru
makepkg -si
2. packages
# terminal
paru -S fish fd fzf ripgrep zoxide atuin bat git-delta direnv jq eza starship lazygit difftastic yazi python-pip python-pipx
# development
paru -S fnm-bin jdk11-openjdk jdk17-openjdk android-platform android-sdk-platform-tools android-sdk-build-tools android-sdk-cmdline-tools-latest
And it’s good enough to start development.
Tips
- Exporting the binary to your host so that you can run the binary directly without entering the distrobox first:
distrobox-export --bin /home/username/Machines/archlinux/.local/bin/harlequin
- Read Distrobox’s useful tips