anchor.diff:  
     # sudo-prompt has hardcoded binary paths on Linux and we patch them here
     # along with some other paths
  -  patchPhase = ''
  -    ${nodePackages.asar}/bin/asar extract opt/balenaEtcher/resources/app.asar tmp
  +  postPatch = ''
       # use Nix(OS) paths
  -    sed -i "s|/usr/bin/pkexec|/usr/bin/pkexec', '/run/wrappers/bin/pkexec|" tmp/node_modules/sudo-prompt/index.js
  -    sed -i 's|/bin/bash|${bash}/bin/bash|' tmp/node_modules/sudo-prompt/index.js
  -    sed -i "s|'lsblk'|'${util-linux}/bin/lsblk'|" tmp/node_modules/drivelist/js/lsblk/index.js
  -    sed -i "s|process.resourcesPath|'$out/share/${pname}/resources/'|" tmp/generated/gui.js
  -    ${nodePackages.asar}/bin/asar pack tmp opt/balenaEtcher/resources/app.asar
  -    rm -rf tmp
  +    substituteInPlace opt/balenaEtcher/resources/app/generated/gui.js \
  +      --replace '/usr/bin/pkexec' '/usr/bin/pkexec", "/run/wrappers/bin/pkexec' \
  +      --replace '/bin/bash' '${bash}/bin/bash' \
  +      --replace '"lsblk"' '"${util-linux}/bin/lsblk"'
     '';
   
     installPhase = ''
  
positive.code: , fetchurl
  , gcc-unwrapped
  , dpkg
  , polkit
  , util-linux
  , bash
  , nodePackages
  , makeWrapper
  , electron_7
  }:
  
  let
    sha256 = {
      "x86_64-linux" = "1yvqi86bw0kym401zwknhwq9041fxg047sbj3aydnfcqf11vrrmk";
      "i686-linux" = "12lghzhsl16h3jvzm3vw4hrly32fz99z6rdmybl8viralrxy8mb8";
    }."${stdenv.system}";
  
    arch = {
  
negative.code:     cp -a usr/share/* $out/share
      cp -a opt/balenaEtcher/{locales,resources} $out/share/${pname}
  
      runHook postInstall
    '';
  
    postFixup = ''
      makeWrapper ${electron}/bin/electron $out/bin/${pname} \
        --add-flags $out/share/${pname}/resources/app \
        --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ gcc-unwrapped.lib ]}"
    '';
  
  