Digital and analog recording mediums have opposite issues with headroom and noise floor, which is where most of the concerns over input level originate, and they're often confused. Analog mediums typically have a very high noise floor (hiss, etc. when the input volume is very low) and a more pleasant compression/distortion along a curve with high input volume (subjectively) and digital mediums typically have a very unpleasant sudden hard clipping at high input volume and very low noise floor (excluding any signal noise somewhere else in the recording chain). The general advise that was always given with analog recording medium is the one you're referencing, to increase input gain until the signal clips and then trim the gain back slightly. This is still assuming you want some tape saturation, which not everyone wanted/wants. There were always recording engineers trying to get the most high fidelity recording possible, trying to minimize both saturation and tape hiss, associated with bouncing down tracks a lot. When I first transitioned from analog to digital I read an interview with Elliot Mazer (Neil Young's frequent recording/mix engineer), who gave a breakdown of how he changed his standard operating procedures and assumptions about signal flow and gain staging to get the best out of digital formats. He discussed the thing about the metering being very different between digital and analog and how one should leave much more headroom for digital recording and not be concerned with the noise floor. I still hear/read a lot of people saying that you shouldn't record at too low of an input gain because of noise floor, clock noise and a bunch of other things that generally aren't a concern, assuming you don't have some other issue with noise from a piece of outboard gear that has nothing to do with the DAW. As soon as I took the advice of tracking with an input gain no higher than -12dB, it drastically improved my recording. The great advantage of digital formats is the ability to add incredible amounts of gain with very little signal noise, compared to multitracking and bouncing on tape, where whatever amount of signal noise you do have is multiplied as you go.
The exact amount of headroom is somewhat subjective, it's best to just try things out and see how it fares for you. I've fluctuated over the years and used as little as -6dB to -12dB or more of headroom while tracking (at peak level). Sometimes it depends on the source, especially if it has a particularly low RMS and high peak. There's so much more that figures into everything once you start mixing, but I've never run into an issue of having too little available volume and I routinely track at a peak of -12dB.
TLDR: Between -6 to -12dB peak input gain is preferable for digital recording. You don't want to get anywhere near clipping. It's much more practical to add volume than try to remove digital clipping.