Captain Jamie Dalrymple and Ben Wright guided Glamorgan to a five-wicket victory which ended Derbyshire's faint hopes of reaching the Friends Provident Trophy quarter-finals.
Derbyshire were bowled out for 211 in 49.1 overs, but despite the home side being reduced to 66 for four in the 18th over, Dalrymple and Wright shared in a fifth-wicket stand worth 135 in 28 overs.
It was a record for a fifth-wicket partnership for Glamorgan in the competition, beating the 129 put on by Tony Lewis and Eifion Jones against Hertfordshire at Swansea in 1969.
Wright was just out before the end for 65, but Dalrymple was there at the end on 78 not out from 111 balls with four fours.
Derbyshire had gone into the game needing to win convincingly and also hoping Essex lost to Lancashire, but after losing the toss the visitors could not build on a good platform.
They had reached 114 for one in the 29th over but some accurate Glamorgan bowling on a helpful pitch saw the visitors' innings rather stutter and fall away.
In the end Derbyshire lost their final six wickets for the addition of just 50 runs.
Glamorgan's reply stuttered at the start, not helped that opener Mark Cosgrove was caught at cover from a slower Wagg ball to leave the home side 15 for one in the third over.
The Welsh county found themselves in more trouble as Michael Powell, O'Shea and Tom Maynard went one after the other before Wright and Dalrymple rebuilt the innings with some good running between the wicket.
After 42 overs Glamorgan took the batting power play with 36 arriving from the first four overs. Despite Wright going caught behind off Smith, Glamorgan went on to win comfortably with 16 balls to spare.