The word denim would be descended from serge de Nîmes. Serge was a general name for woolen, half-woolen and silk twill fabrics.
Nîmes, a town in the south of France, in the 18th century played an important role in the production of textiles, including serge. In this period there was also a woollen fabric from Spain, known by the name nim.
Whether denim is really derived from ‘de Nîmes’ remains subject of discussion. See also ‘Denim’.
Source: Nouvelle de Nîmes Nº 5: The Denim Dictionary