"Why Luton? Going from the Conference to the Premier League is a great story and for me personally to be back in the Premier League, it's great motivation," Barkley said in a statement.
He played 28 games for Nice in all competitions last season, scoring four times. Barkley previously made over 200 Premier League appearances, scoring 29 goals, for Everton and Chelsea.
Luton are making their Premier League debut and Barkley is a welcome addition to manager Rob Edwards' squad.
"Ross brings loads of experience at the top level, has international experience and brings an x-factor," Edwards said.
"He gives us something different, he has that ability to make something out of nothing and we need that in the Premier League."
Barkley will wear the No. 6 shirt and could make his Luton debut at Brighton & Hove Albion on Saturday.