If the value of an option has type “submodule” that basically means it should be an attribute set that contains other known options. The attributes it expects are described below it in the Home Manager documentation. You likely only have to set programs.git.signing.key to the key that you want to use.
sudo gpg2 --list-keys
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
Should nixos creating a key through the config I made or do I have to do it manually?