anchor.diff:        '';
       };
   
  -    buildInputs = if stdenv.hostPlatform.system == "x86_64-darwin"
  -      then [ unzip libXScrnSaver libsecret ]
  -      else [ wrapGAppsHook libXScrnSaver libxkbfile libsecret ];
  +    buildInputs = (if stdenv.isDarwin
  +      then [ unzip ]
  +      else [ gtk2 at-spi2-atk wrapGAppsHook ] ++ atomEnv.packages)
  +        ++ [ libsecret libXScrnSaver ];
  +
  +    nativeBuildInputs = lib.optional (!stdenv.isDarwin) autoPatchelfHook;
   
       installPhase =
         if stdenv.hostPlatform.system == "x86_64-darwin" then ''
  
positive.code:       '';
  
      postFixup = lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") ''
        patchelf \
          --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
          --set-rpath "${rpath}" \
          $out/lib/vscode/${executableName}
  
        patchelf \
          --set-rpath "${rpath}" \
          $out/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node
  
        patchelf \
          --set-rpath "${rpath}" \
          "$out/lib/vscode/resources/app/node_modules.asar.unpacked/native-keymap/build/Release/\
        keymapping.node"
  
        ln -s ${lib.makeLibraryPath [libsecret]}/libsecret-1.so.0 $out/lib/vscode/libsecret-1.so.0
      '';
  
negative.code: { stdenv, lib, fetchurl, makeDesktopItem
  , unzip, libsecret, libXScrnSaver, wrapGAppsHook
  , gtk2, atomEnv, at-spi2-atk, autoPatchelfHook
  , systemd, fontconfig
  , isInsiders ? false }:
  
  let
    executableName = "code" + lib.optionalString isInsiders "-insiders";
  