Skip to main content
blog.chobble.com

I made an Eleventy & Nix static site template

I've had to create a new Eleventy site on NixOS a bunch of times lately, so I figured I make a template to save myself repeating the same steps over and over.

Hopefully this will come in helpful for anyone else who's attempting to build Eleventy (or any other npm-based site generator) on NixOS.

The source code for the template I made is here: git.chobble.com/chobble/empty-eleventy-nix-site

To get started just run git clone https://git.chobble.com/chobble/empty-eleventy-nix-site, then cd to the directory, run direnv allow or nix develop, and then serve to get a server running locally.

You can also run nix-build to reproducibly build the site using Nix - I call this from my NixOS site builder which powers the Chobble server.

To quote its README.md:


This template should let you get started with the Eleventy static site builder on NixOS / Nix, really easily.

Featuring Nix'y features like:

And Eleventy features like:

Changing Packages

If you want to change the packages in packages.json, here's the steps:

Upgrading Packages

This is a little fiddlier:

..I do intend to make those steps simpler some day. If you've got ideas of how I could, please contact me!