Blog Home

Setting up my blog development with Nix

2022-08-17

If you're reading this then I have successfully created my website! Yay! Unforunately this was not without its frustrations which I will be detailing in this post...

A week ago I figured I would get back to maintaining a website and maybe writting some blog posts. My intent was to use a simple static site generator and a simple host to accomplish this. I ended up choosing Zola for my SSG and Netlify as my host.

My pain began though when I decided I should try to use Nix to manage my development environment. Yikes.

This was my second foray into using Nix to create a development shell for a project. The first was a dev shell for Zephyr development. You can read more about that here. After this first one I decided I'd like to apply what I learned to a development shell for my website environment.

This in theory should have been a simpler task than the Zephyr SDK. Here's the list of items I felt I needed to do:

  • zola
  • netlify CLI
  • git

That's it! It shouldn't be that bad right? Wrong, here's where I hit all of my previously experienced painpoints again. The netlify package is out of date. Great I'll build from scratch with one of the Node + Nix tools. Nope, one tool can't handle packages that use shrinkwrap.json files and the other fails to build the package during the prepare step. At this point I gave up using Nix for this package and installed the CLI as the instructions specified.

But no, that also did not go as simple as planned. The Ubuntu version I am using with WSL2 (Ubuntu 20.04) only has node v10.19.0, so now I have to contend with that. I finally threw up my arms, installed NVM and netlify as a global package and called it a day.

So now at this point I'm mad about Nix and NodeJS and while I have a dev shell of some sort, it's not completely isolated. At least zola + git works 🙃.