{config, pkgs, ...}:

{
  sops.secrets.anki = { };
  services.anki-sync-server = {
    enable = true;
    port   = 7333;
    address = "0.0.0.0";
    users = [
      {
        username = "David";
        passwordFile = config.sops.secrets.anki.path;
      }
    ];
  };
  services.caddy.virtualHosts = {
    "anki.syzygial.cc" = {
      extraConfig = ''
        reverse_proxy 127.0.0.1:${toString config.services.anki-sync-server.port}
      '';
    };
  };
}
