My MacBook Pro M1 keyboard broke too and Apple wanted $900 to replace it. I bought a $30 replacement on Amazon and started replacing it myself. Unfortunately the repair was a bit too complicated for me, but luckily one of my co-workers had more patience and replaced it for some beer.
This video is a good overview: https://www.youtube.com/watch?v=pGmMpEEP5ls
I don't even understand the functional purpose of the rivets if the keyboard is already held in place with a million screws and the key slots cut into the aluminum frame. It makes no sense, seems like a waste.
Thankfully the m1 was the last of the evil design era for Macs. Modern ones are significantly better. The neo being the best, able to be fully disassembled with a screw driver in a few minutes