The value of X is determined only as Peer Past the Veil resolves, after you discard your hand. Since Peer Past the Veil is still on the stack while it's resolving, it won't count itself.

Artwork
Loading artwork…
Peer Past the Veil
Duskmourn: House of Horror · #226 · EN
Nonfoil—Foil—
Card rules
Discard your hand. Then draw X cards, where X is the number of card types among cards in your graveyard.
Those who glimpse the House's true nature firsthand are cursed to never again look away.
Rare · Illustrated by Tuan Duong Chu
Format legality
Alchemy Legal
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Vintage Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
PreDH Not Legal
Premodern Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions