{ ... }:
{
  _class = "clan.service";
  manifest.name = "vikunja";
  manifest.description = "The to-do app to organize your life.";
  manifest.readme = "The to-do app to organize your life.";
  manifest.categories = [ "System" ];

  roles.default = {
    description = "a default server role";
    perInstance.nixosModule =
      {
        lib,
        config,
        ...
      }:
      {
        clan.core.state.vikunja.folders = [
          config.services.vikunja.settings.files.basepath
        ]
        ++ (
          if config.services.vikunja.settings.database.type == "sqlite" then
            [ config.services.vikunja.settings.database.path ]
          else
            [ ]
        );
        services.vikunja = {
          enable = lib.mkDefault true;
          frontendScheme = lib.mkDefault "http";
          frontendHostname = lib.mkDefault "localhost";
        };
      };
  };
}
