Move some code around
Move some code around

In particular, do replacing of valid paths during repair later.  This
prevents us from replacing a valid path after the build fails.

offlinehacker/nix,bjornfor/nix,aucampia/nix,bjornfor/nix,dezgeg/nix,layus/nix,acowley/nix,jcumming/nix,gebner/nix,gridaphobe/nix,ehmry/nix,layus/nix,rycee/nix,bjornfor/nix,tchajed/nix,layus/nix,garbas/nix,NixOS/nix,vcunat/nix,NixOS/nix,rowhit/nix,gridaphobe/nix,acowley/nix,ttuegel/nix,ehmry/nix,rycee/nix,dezgeg/nix,jcumming/nix,joelmo/nix,bennofs/nix,rycee/nix,zimbatm/nix,rowhit/nix,gebner/nix,jcumming/nix,bennofs/nix,rycee/nix,ysangkok/nix,ysangkok/nix,dtzWill/nix,bennofs/nix,offlinehacker/nix,rowhit/nix,ysangkok/nix,garbas/nix,acowley/nix,shlevy/nix,pikajude/nix,vizanto/nix,wmertens/nix,garbas/nix,nbp/nix,puffnfresh/nix,ehmry/nix,offlinehacker/nix,garbas/nix,zimbatm/nix,tchajed/nix,zimbatm/nix,layus/nix,vcunat/nix,zimbatm/nix,dtzWill/nix,pikajude/nix,ttuegel/nix,ttuegel/nix,ehmry/nix,peti/nix,dtzWill/nix,dezgeg/nix,puffnfresh/nix,peti/nix,peti/nix,tchajed/nix,NixOS/nix,tchajed/nix,wmertens/nix,garbas/nix,dezgeg/nix,ehmry/nix,joelmo/nix,NixOS/nix,nbp/nix,vizanto/nix,shlevy/nix,shlevy/nix,peti/nix,rycee/nix,pikajude/nix,ehmry/nix,nbp/nix,wmertens/nix,vcunat/nix,wmertens/nix,layus/nix,NixOS/nix,dtzWill/nix,gridaphobe/nix,gebner/nix,bjornfor/nix,dtzWill/nix,gebner/nix,shlevy/nix,bennofs/nix,acowley/nix,vizanto/nix,ttuegel/nix,joelmo/nix,dezgeg/nix,vizanto/nix,aucampia/nix,aucampia/nix,peti/nix,rowhit/nix,shlevy/nix,puffnfresh/nix,jcumming/nix,nbp/nix,offlinehacker/nix,aucampia/nix,puffnfresh/nix,gridaphobe/nix,joelmo/nix,vcunat/nix