New elements in old tools: nucleosynthesis in N-body codes