Gpg --refresh-keys fails

> gpg --refresh-keys fails
gpg: connecting dirmngr at '/run/user/1000/gnupg/S.dirmngr' failed: IPC connect call failed
gpg: keyserver refresh failed: No dirmngr

This are the relevant part in my nixos configuration

I had no permission for .gnupg/crls.d. I fixed it with sudo rm -r .gnupg/crls.de