Reassigning to the right D-I component.
However, in user-setup-apply:
if [ -e $ROOT/etc/sudoers ]; then
# Test if we can add the user to the sudo group
# (possible if sudo>= 1.7.2-2 is installed on the target system)
# If we can, do it this way, otherwise add the user to sudoers
# See #597239
if ! $log $chroot $ROOT adduser "$USER" sudo>/dev/null 2>&1; then
echo "$USER ALL=(ALL) ALL">> $ROOT/etc/sudoers
fi
else
# sudo failed to install, system won't be usable
exit 1
fi
In short, according to this code, this is already implemented, as of
user-setup 1.34, assuming the sudo group exists at the time this is
done. Adding the sudo user to sudoers is only a fallback.