Deploying this site with Nix + Zola

This site is built by Zola inside a Nix derivation and served by Caddy on a Linode VPS.

Why Zola?

Zola is a single static binary. It needs no runtime dependencies beyond the HTML it produces.

A sample table

ToolRole
ZolaStatic site generator
NixReproducible build
CaddyHTTPS + file server

A sample code block

{ pkgs, ... }:

pkgs.stdenvNoCC.mkDerivation {
  name = "stuckinvim-site";
  src = ./.;
  nativeBuildInputs = [ pkgs.zola ];
  buildPhase = ''
    zola build --root $src --base-url https://stuckinvim.io
  '';
  installPhase = ''
    cp -r public $out
  '';
}

A blockquote

The best build is the one that finishes the same way every time.

That is the point of pinning the source and the builder in one Nix flake.