More tidying. Moving this monadic procedure to the more sensible place will allow reuse in other scripts. 'guix deploy' will use it.