How to fix the capslock delay in NixOs?

CAps lock is broken when used to uppercase characters instead of SHift.

IN my search, I’ve found this but I do not know how to properly include a script using that runs after every login using NIx flakes or the config file.

I’m on 23.11 with KDE plasma5. I hope for a solution that will work in both xorg and wayland. Thank you so much for any assistance.