For the past two years, this site has been hosted on SIPB’s amazing XVM service. Unfortunately, it’s not all sunshine and rainbows. XVM is nearly 20 years old and definitely showing its age, and yesterday’s MIT certpocalypse completely broke the XVM website.

Recently, I’ve been helping out with SIPB’s Hyades project, which aims to eventually replace both XVM and Scripts. Hyades isn’t quite ready yet, but I’ve already migrated this website from XVM to Hyades, and it seems to work pretty well so far! Hyades also builds my site in only 5 seconds compared to 15 on XVM, and I’m no longer limited to 512 MB of RAM.

Hyades runs compute workloads as libkrun microVMs, so I had to build my site’s NixOS system configuration as a Docker image:

pkgs.dockerTools.buildLayeredImage {
  name = "forgejo.mit.edu/xy/nixos-config";
  tag = "latest";
  # Yeah just chuck the whole toplevel in there
  contents = [ self.nixosConfigurations.Unnamed-Server.config.system.build.toplevel ];
  # This runs nixos/modules/system/boot/stage-2-init.sh
  config.Entrypoint = [ "/init" ];
  # The toplevel has an /etc symlink so nuke it to get a writable /etc
  extraCommands = ''
    rm -f etc
    mkdir etc
  '';
};

I also added "${nixpkgs}/nixos/modules/profiles/docker-container.nix" to the list of modules for the NixOS config.

Then one nix build && podman load < result later, it’s ready to be run!

podman run --runtime=krun -p 2222:2222 -e KRUN_INIT_PID1=1 forgejo.mit.edu/xy/nixos-config # Other unimportant flags omitted

Shockingly, this cursed abomination actually works (although to get networking inside the microVM I had to disable dhcpcd and hardcode the DNS nameservers), and is now powering this website!