{ config, ... }:
{
  clan.core.vars.generators.b4l-vikunja = {
    files.subdomain.secret = false;

    prompts = {
      subdomain = {
        persist = true;
        type = "line";
        description = "Sub-domain for Vikunja todo app. Default:(todo)";
      };
    };

    script = ''cat $prompts/subdomain || echo "todo" > $out/subdomain'';
  };
  services.vikunja = {
    frontendHostname = "${config.clan.core.vars.generators.b4l-vikunja.files.subdomain.value}.${config.networking.fqdn}";
  };
  services.nginx.virtualHosts."${config.services.vikunja.frontendHostname}" = {
    useACMEHost = "${config.networking.fqdn}";
    forceSSL = true;
    locations."/" = {
      proxyPass = "${config.services.vikunja.frontendScheme}://${config.services.vikunja.frontendHostname}:${builtins.toString config.services.vikunja.port}";
    };
  };
}
