Hydrogen resist lithography using the tip of a scanning tunneling microscope (STM) is employed for patterning p-type nanostructures in silicon. For this, the carrier density and mobility of boron δ-layers, fabricated by gas-phase doping, are characterized with low-temperature transport experiments. Sheet resistivities as low as 300 Ω are found. Adsorption, incorporation and surface diffusion of the dopants are investigated by STM imaging and result in an upper bound of 2 nm for the lithographic resolution which is also corroborated by fabricating a 7.5 nm wide p-type nanowire and measuring its electrical properties. Finally, to demonstrate the feasibility of bipolar dopant device fabrication with this technique, we prepared a 100 nm wide pn junction and show that its electrical behavior is similar to that of an Esaki diode.