Enzyme that can either act as an ADP-sugar pyrophosphatase in absence of diphosphate or catalyze the synthesis of ATP in presence of diphosphate. In absence of diphosphate, hydrolyzes with similar activities various modified nucleoside diphosphates such as ADP-ribose, ADP-mannose, ADP-glucose, 8-oxo-GDP and 8-oxo-dGDP. Can also hydrolyze other nucleotide sugars with low activity. In presence of diphosphate, mediates the synthesis of ATP in the nucleus by catalyzing the conversion of ADP-ribose to ATP and ribose 5-phosphate. Nuclear ATP synthesis takes place when dephosphorylated at Thr-45. Nuclear ATP generation is required for extensive chromatin remodeling events that are energy-consuming. Does not play a role in U8 snoRNA decapping activity. Binds U8 snoRNA. ATP + D-ribose 5-phosphate + H(+) = ADP-D-ribose + diphosphate ADP-D-ribose + H2O = AMP + D-ribose 5-phosphate + 2 H(+) 8-oxo-dGDP + H2O = 8-oxo-dGMP + H(+) + phosphate Binds 3 Mg(2+) ions per subunit. Homodimer. Interacts with PARG. Phosphorylation at Thr-45 is required for homodimer stability; dephosphorylation results in destabilization of the homodimer. Dephosphorylation at Thr-45 promotes the ATP-synthesis activity. Belongs to the Nudix hydrolase family.