about this site

This site is built with Nix. And by that I don’t mean “I run Hakyll through nix” or something sane like that, but most of the data processing happens through a cursed combination of pandoc and nix.

At every turn, I tried to think “what is the most nixy way to do this?”, which led to me to do some stupid stuff.

You can find the source on codeberg.

For example, you may notice my button has an url in /nix/store/?

my 88x31 button

It actually starts its life as a nix expression:

{
  lib,
  imagemagick,
  runCommand,
  mkFetch,
}:

let
  dataOther = mkFetch (lib.importTOML ../data/other.toml);
  steelAndGlass = dataOther.steel_and_glass.path;
in

runCommand "syn-88x31.png"
  {
    nativeBuildInputs = [ imagemagick ];
  }
  ''
    magick \
      ${steelAndGlass} \
      -resize 88x88 \
      -crop 88x31+0+0 \
      $out
  ''

This is interpolated directly into pages (which are also nix expressions). I then use closureInfo to determine what actually has to go into the closure for the upload to codeberg pages.

Would I reccomend you do this for your own website? Probably not…

If you want to hotlink to this button don’t use the nix store url BTW, since that’s prone to change without notice. Instead, use the following. Don’t worry, it’s still being built in the same silly way.

<a href="https://syn.cat/" target="_blank">
    <img src="https://syn.cat/88x31.png">
</a>