Honestly, I think this should be quite doable. These guys [1] built a pump based on a stepper motor and an arduino, in order to replace expensive peristaltic laboratory pumps.
[1] https://www.instructables.com/id/Open-Source-Peristaltic-Pum...
[1] https://www.instructables.com/id/Open-Source-Peristaltic-Pum...
It can also quite easily kill you in your sleep if you mess up the implementation, so ymmv.