anchor.diff:    installPhase = ''
       mkdir -pv $out
   
  -    ar p $src data.tar.gz | tar -C $out -xz ./usr
  -
  -    substituteInPlace $out/usr/share/applications/atom.desktop \
  -      --replace /usr/share/atom $out/bin
  -
  +    ar p $src data.tar.gz | tar -C $out -xz
       mv -v $out/usr/* $out/
  -    rm -rv $out/share/lintian
       rm -rv $out/usr/
   
  -    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
  +    sed -i $out/share/applications/atom.desktop \
  +      -e 's,/usr/share/atom,$out/share/atom,'
  +
  +    rm -rv $out/share/lintian
  +  '';
  +
  +  preFixup = ''
  +    patchelf \
  +      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
  +      --set-rpath "$out/share/atom:${atomLibs}" \
         $out/share/atom/atom
  -    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
  +
  +    patchelf \
  +      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
  +      --set-rpath "$out/share/atom:${atomLibs}" \
         $out/share/atom/resources/app/apm/bin/node
   
  -    wrapProgram $out/bin/atom \
  -      --prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64" \
  +    wrapProgram $out/share/atom/atom \
  +      --prefix "LD_LIBRARY_PATH" : "${atomLibs}" \
         --prefix "PATH" : "${gvfs}/bin"
  +
       wrapProgram $out/bin/apm \
  -      --prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64"
  +      --prefix "LD_LIBRARY_PATH" : "${atomLibs}"
     '';
   
     meta = with stdenv.lib; {
  
positive.code: , libcap
  , libgnome-keyring
  , libgpg-error
  , nspr
  , nss
  , pango
  
negative.code:     makeWrapper
    ];
  
    atomLibs = makeLibraryPath [
      alsa-lib
      atk
      bzip2
      cairo
      cups
      dbus
      expat
      fontconfig
      freetype
      gconf
      gdk-pixbuf-core
      glib
      gtk2
      libcap
      libgnome-keyring
      libgpg-error
      libnotify
      libpng
      nspr
      nss
      pango
      xorg.libX11
      xorg.libXau
      xorg.libxcb
      xorg.libXcomposite
      xorg.libXcursor
      xorg.libXdamage
      xorg.libXdmcp
      xorg.libXext
      xorg.libXfixes
      xorg.libXi
      xorg.libXrandr
      xorg.libXrender
      xorg.libXtst
      xorg.xcbutil
      stdenv.cc.cc
      systemd_lib
      zlib
    ];
  
    unpackPhase = "true";
  