Thanks for that. Reason I had it as base is because in the yum file i had changed the repoid to base so it downloads to a folder called base and this works. But kickstart just has issues seeing it. Now this has worked in the past with centos 7 and with almalinux.
The command I am now using is:
dnf reposync -g --delete -p /home/www/html/repos/rockylinux/8.7/ --repoid=baseos --newest-only --downloadcomps --download-metadata
The error i get is
error setting up base repository
failed to set up installation source
The path in my kickstart is
repo --name=baseos --baseurl=nfs://servername:/home/www/html/repos/rocklinux/8.7/baseos/