Ten years, counted by permit
The Federal Act requires 10 years of residence, 3 of them within the 5 years before the application, and a C settlement permit. Years between the ages of 8 and 18 count double, with at least 6 years of actual residence.
Time on an L or N permit does not count; F permit time counts half. Cantons add their own 2 to 5 years in the canton or commune.