modernize nixos-generate-config

(cherry picked from commit 88a8ec37d3459448302bab4b84c69e00e04ec5bf)