Hacker News new | ask | show | jobs
by linsomniac 11 days ago
I've redesigned my workstation OS using NixOS and Claude Code and it's been a huge success.

I like the ideals of NixOS: reproducible setup from a git repo, ability to boot into a past config if you mess things up. But it's a big job learning and implementing that configuration manually. I've been playing with NixOS for ~2 years and like it but never really got that close to a full workstation setup.

When Ubuntu 26.04 came out I really needed to upgrade my 22.04 workstation and decided I'd really give NixOS a try before going with 26.04.

This time I decided to entirely configure it via Claude Code. I've been entirely running on it for a week and there's nothing I'm missing. I even took a stepping-stone approach where I first installed it on my old laptop, left my current workstation in place (in case the experiment failed), and then did a reinstall of my current workstation. NixOS made setting up the second machine trivial. Now, if my normal workstation were to have a hardware failure, I can just grab my /etc/nixos and rebuild and I'm back in business. Which is important since my workstation is now out of warranty and 6 years old.

One win is that I had been using LunarVim and AstroVim, and liked the "batteries included" approach, but they were hard to upgrade and while I was trying to do as little customization as possible, I still needed to do some and that was tricky in their configs. I used Claude Code to build a neovim setup with just my desired features, and it's now a single ~700 line neovim.nix file with everything in it. It's fully featured including LSPs+TreeSitter, etc.

1 comments

I’d love to give NixOS a try on an old ThinkPad. I’m pretty comfortable with Claude; is it as simple as ask and go, or do you have any suggestions for getting started?
That's exactly what I did, an old ThinkPad t470s.

I installed NixOS, and then I copied /etc/nixos down to my main workstation where I had claude code working, and used it to modify the configs. I'd then rsync them to the other machine and run the "nixos-rebuild" there.

I don't recall exactly how I did the initial copies, because SSH wasn't set up there. Probably would be best to just ask claude what needs to be done to enable SSH, it's only like a 1 line change.

Some of the first things I asked it to do were:

    - Switch to flakes and tracking the latest software.
    - Switch to using Sway for window manager.
    - Various user account setup things: Configure zsh with atuin and zoxide, enable sudo, allow my SSH key for login, set up some aliases and the software I need.
    - Install claude code (I gave it the "installing" URL) once I got tired of copying back and forth.
    - Set up Home Manager and SOPS and put my secrets in SOPS, set up a variety of my scripts and symlinks.
    - Configure vim to my liking (done entirely in English prose).
Those are the top things that come to mind. Honestly, it went pretty smoothly. The only real issue I had to speak of was that I'm running bleeding edge, and the moment I decided to unplug my desktop monitors from the Ubuntu machine and connect them to NixOS I had it do a package update at the same time. This hit a Gnome+Wayland bug which left me at a black screen. A nice thing about NixOS is you can just reboot and at the grub menu select an older system config, so I did that. Claude tracked down an open bug about it, tried a few mitigations, but eventually I told it to just revert the version of gnome until it was fixed upstream.

It has gone extremely smoothly. Zero regrets. My manual attempts at NixOS always ran me into dark corners that I didn't know how to do (like installing gitbutler-cli, which is not packaged for NixOS yet), and Claude had no trouble figuring out.

One addition: Flakes is something that I think Claude recommended at the point I switched over to home manager+SOPS. Flake, Home Manager, and SOPS were all things I was somewhat aware of from my previous attempts at NixOS. If you are coming in brand new, I'd probably recommend asking Claude to start with flakes sooner rather than later. Just specifically ask it to use flakes.

Pretty much everything else I did without asking Claude much in the way of NixOS specifics. I just described what I want in general terms.