How does adding and using a custom keyboard-layout work?

A good start.

That explains that the xkeyboard-config package contains all the keyboard configurations and that /run/current-system/profile/share/keymaps folder contains the available keymaps used.

Unfortunately, I seem to have have two xkeyboard-config folders in /gnu/store with the same version and I’m not sure why that is, but I think it’s related to another issue I have.