Use replaceStrings to $out

How to use builtin.replaceStrings to change the backlash in mkSerivation’s $out?
I tried with
_out = builtin.replaceStrings ["/"] ["\\/"] "$out";
but _out is the same as $out

full code:

tmuxconfig = stdenv.mkDerivation {           
  name = "ohmytmux";                         
  src = ohmytmux;                            
  postPatch = ''                             
      substituteInPlace .tmux.conf \         
        --replace "~/" "$out/" \             
        --replace "~\/" "$out\/"             
  '';                                        
  installPhase = ''                          
    mkdir -p $out/;                          
    cp .tmux.conf $out/                      
    cp ${./tmuxlocal} $out/.tmux.conf.local  
  '';                                        
};                                           

the purpose is to replace / in $out to \/

I found that I need to do the sed in postPatch context, not mkDerivation context.