In the US it appears to be a controlled substance (Schedule IV), which means that importing/possessing/whatever without a prescription is illegal. However, the vendor I linked to regularly ships to the US without any issues. Friends of mine from the tech industry living in SF and NYC have not had problems, at least, ordering from that source.
RE: Some thoughts on Modafinil.