See, e.g., How can I generate a topology for a peptide contain unnatural amino acids and a linker ?, Modified Residue topology - Gromacs 2020 and Topology creation for an acylated amino acid in Charmm force field.