I run NixOS as my daily driver. Failed a live coding interview for a Rails position. Not because of code but because I couldn’t get their app running in time.
The situation:
- Asked company to sent a Gemfile beforehand to prepare. Actual project Gemfile didn’t match with minor difference.
- Project included a Dockerfile, but it was broken: missing system deps, hardcoded localhost URLs, no docker-compose for Postgres/Redis, invalid Bundler platform. (probably was never suppose to be used)
- Communicated before the interview that I can’t install natively due to my OS. Interviewer watched the build fail, left for 50 minutes with task (part of the interview process).
- Spent the entire session debugging their environment instead of writing features (but still wrote some code).
- Submitted a working Docker fix + full patch after. Company declined a redo (Interviewer aknowledge the problem and told I need a second try).
I got very frustrated after, and started to research flake.nix per project worked well before but ruby-3.1.2 is no longer in nixpkgs. And I managed it to run from github:bobvanderlinden/nixpkgs-ruby.
I tried the rbenv approach in my nix config:
programs.rbenv = {
enable = true;
plugins = [{
name = "ruby-build";
src = pkgs.fetchFromGitHub {
owner = "rbenv";
repo = "ruby-build";
rev = "v20260326";
hash = "sha256-7BceEdzBf2kjzLrAZf1kbS6tGoFercH7adw8fo2uBvE=";
};
}];
};
but ruby install fails because:
- No gcc in PATH Need gcc, gnumake, autoconf, pkg-config in home.packages.
- zlib.h: No such file or directory
- RUBY_CONFIGURE_OPTS needed - must explicitly pass --with-openssl-dir, --with-zlib-dir, --with-readline-dir, --with-libyaml-dir pointing to Nix bin in store
- home.sessionVariables don’t help immediately - need shell restart, and setting global CFLAGS/LDFLAGS affects all builds, not just Ruby.
Even with all deps added to home.packages and sessionVariables configured, ruby-build still fights.
Working example installing it from zsh (not possible or convenient to run this each time) also not sure it will work properly switching ruby versions on different projects.
RUBY_BUILD_SKIP_OPENSSL_COMPILE=1 \
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(nix eval --raw nixpkgs#openssl.dev) --with-zlib-dir=$(nix eval --raw nixpkgs#zlib.dev) --with-readline-dir=$(nix eval --raw nixpkgs#readline.dev)
--with-libyaml-dir=$(nix eval --raw nixpkgs#libyaml)" \
CFLAGS="-I$(nix eval --raw nixpkgs#zlib.dev)/include" \
LDFLAGS="-L$(nix eval --raw nixpkgs#zlib.out)/lib" \
rbenv install 3.1.2
My questions for the community:
- How do you handle interviews/onboarding that assume apt-get/brew? Do you keep a non-NixOS VM ready? Distrobox? Docker only? Something else?
- Is rbenv on NixOS a lost cause? Has anyone gotten rbenv install working reliably via home-manager without a wrapper nix-shell? I have flake.nix per local project but need something for situations like that
- Is nixpkgs-ruby / pure Nix the only real answer? My flake with bobvanderlinden/nixpkgs-ruby works great, but it’s unfamiliar to teams expecting rbenv.
- Older versions are no longer supported, but still older ruby version are used widely by companies
Not looking for sympathy or say the tool genuinely not working for situations like that. I am thinking moving on from nixos as my dev machine because of the overhead it is causing and missed opportunities. Want to know if I’m doing something wrong or if this is the current state of Ruby on NixOS?