How to use a GPG Smartcard for Git and SSH

A guide on using a GPG compatible SmartCard such as the NitroKey or YubiKey for Git and SSH. This guide assumes that you are using a YubiKey and NixOS, but should largely be reusable for other SmartCards and Linux Operating Systems. Due to current limitations, you cannot have multiple SmartCards that all work simultaneously using the same keys. You can however copy the backed up keys to a ...