{config, ...}: {
  virtualisation.oci-containers.containers."baserow" = {
    image = "docker.io/baserow/baserow:2.0.6";
    environmentFiles = [config.age.secrets.baserow-env.path];
    ports = ["127.0.0.1:${toString (config.m3ta.ports.get "baserow")}:80"];
    volumes = ["baserow_data:/baserow/data"];
    extraOptions = ["--add-host=postgres:10.89.0.1" "--ip=10.89.0.10" "--network=web"];
  };
  # Traefik configuration specific to baserow
  services.traefik.dynamicConfigOptions.http = {
    services.baserow.loadBalancer.servers = [
      {
        url = "http://localhost:${toString (config.m3ta.ports.get "baserow")}/";
      }
    ];

    routers.baserow = {
      rule = "Host(`br.m3ta.dev`)";
      tls = {
        certResolver = "godaddy";
      };
      service = "baserow";
      entrypoints = "websecure";
    };
    routers.baserow-old = {
      rule = "Host(`br.m3tam3re.com`)";
      tls = {
        certResolver = "godaddy";
      };
      service = "baserow";
      entrypoints = "websecure";
      middlewares = ["subdomain-redirect"];
    };
  };
}
