anchor.diff:      "-DUSE_BACKEND=CUDA"
     ] ++ lib.optionals (enableGPU && !enableCuda) [
       "-DUSE_BACKEND=OPENCL"
  +  ] ++ lib.optionals enableContrib [
  +    "-DBUILD_DISTRIBUTED=1"
  +    "-DNO_GIT_REVISION=OFF"
  +    "-DGIT_EXECUTABLE=${fakegit}/bin/git"
     ] ++ lib.optionals enableTcmalloc [
       "-DUSE_TCMALLOC=ON"
     ] ++ lib.optionals enableBigBoards [
  
positive.code: 
  in env.mkDerivation rec {
    pname = "katago";
    version = "1.6.1";
  
    src = fetchFromGitHub {
      owner = "lightvector";
      repo = "katago";
      rev = "v${version}";
      sha256 = "030ff9prnvpadgcb4x4hx6b6ggg10bwqcj8vd8nwrdz9sjq67yf7";
    };
  
    nativeBuildInputs = [
      cmake
  
negative.code: { stdenv
  , gcc8Stdenv
  , boost
  , cmake
  , cudatoolkit
  , cudnn
  , eigen
  , fetchFromGitHub
  , fetchpatch
  , gperftools
  , lib
  , libzip
  , makeWrapper
  , mesa
  , ocl-icd
  , opencl-headers
  , openssl
  , writeShellScriptBin
  , enableAVX2 ? stdenv.hostPlatform.avx2Support
  , enableBigBoards ? false
  , enableCuda ? false
  , enableContrib ? false
  , enableGPU ? true
  , enableTcmalloc ? true
  }:
  
  assert !enableGPU -> (
    !enableCuda);
  
  let
    env = if enableCuda
  