The Proto-Indo-European root is *weiḱ- "clan". In Latin it became vīcus "district", and this was borrowed into Old English as wīc "town". This survives today in the word bailiwick and many place names, such as Norwich and Chiswick.
*weiḱ- became Greek οἶκος oikos "house". English ecology is from oikos plus λόγος logos "discourse" (from PIE *leǵ- "to collect, speak").
The suffixed *weiḱ-slā became Latin vīlla "country house". Old French vilein was a serf, someone who lived in the country. In English it took on the meaning of "depraved scoundrel".
According to the AHD, nasty is perhaps from Old French nastre "bad, strange", a shortened form of villenastre - that is, vilein with the perjorative suffix -astre. villenastre was reanalyzed as vilein nastre, then nastre came to be used in other contexts like fol nastre "foolish, mad", and natre felun "poor wretch". The forms natre, nadre still survive in Normandy and Gascony with the meanings "bad, cruel, tricky, mad, brutal". (see "The Etymology of Nasty" by Ralph de Gorog, American Speech, Vol. 51, No. 3/4, pp. 276-278.)
The OED states: "Of obscure origin: cf. Du. nestig (? MDu. nistich) foul, dirty, the history of which is obscure. The early form naxty and Cotgrave's nasky may indicate a stem nasc-, which also appears in Sw. dial. naskug, nasket (Rietz) dirty, nasty, but the ultimate relationship of the forms is not clear."