How to add a nix registry in my configuration.nix?

I have a templates flake that contains some additional templates along with the official ones. Instead of using nix registry add, which I would have to do on all systems, I would like to add the registry in my configuration.nix, so I won’t have to repeat the steps.

I do not know how to do this in code, can anyone please show me a code snippet? Thanks in advance

Check nix.registry