The defender made 10 appearances across all competitions in his short spell with the Guys last season.
Attal has three caps for Algeria since making his debut against Guinea in the 2019 Africa Cup of Nations qualifiers.
On Tuesday, the Allianz Riviera side announced the capture of the youngster, becoming the third signing of the club following the arrival of Danilo Barbosa and Christophe Herelle.
“OGC Nice has come to an agreement with the club from the Jupiler Pro League for the transfer of the highly exciting 22-year-old,” read a statement on club website.
“After passing his medical on Tuesday, he has now become the third Nice signing of the summer, after Danilo Barbosa and Christophe Hérelle.”