anchor.diff:      owner = "KhronosGroup";
       repo = "Vulkan-ValidationLayers";
       rev = "sdk-${version}";
  -    sha256 = "1mpqmxh9zm20jdar59lp4yjpqfzxn2pwds6bkvnzihfy0pymf15k";
  +    sha256 = "1mp110a686lwl6wfplg79vwnlrvbz2pd5mjkgyg9i3jyfs65lr33";
     };
   
  +  # Include absolute paths to layer libraries in their associated
  +  # layer definition json files.
  +  postPatch = ''
  +    sed "s|\([[:space:]]*set(INSTALL_DEFINES \''${INSTALL_DEFINES} -DRELATIVE_LAYER_BINARY=\"\)\(\$<TARGET_FILE_NAME:\''${TARGET_NAME}>\")\)|\1$out/lib/\2|" -i layers/CMakeLists.txt
  +  '';
  +
     nativeBuildInputs = [
  -    pkg-config
       cmake
  -    python3
     ];
   
     buildInputs = [
  -    localGlslang
  -    localGlslang.spirv-headers
  -    vulkan-headers
  -    vulkan-loader
  +    libX11
       libxcb
       libXrandr
  +    vulkan-headers
       wayland
     ];
   
     cmakeFlags = [
       "-DGLSLANG_INSTALL_DIR=${localGlslang}"
       "-DSPIRV_HEADERS_INSTALL_DIR=${localSpirvHeaders}"
  +    "-DROBIN_HOOD_HASHING_INSTALL_DIR=${robin-hood-hashing}"
       "-DBUILD_LAYER_SUPPORT_FILES=ON"
  +    # Hide dev warnings that are useless for packaging
  +    "-Wno-dev"
     ];
   
  -  # Include absolute paths to layer libraries in their associated
  -  # layer definition json files.
  -  patchPhase = ''
  -    sed "s|\([[:space:]]*set(INSTALL_DEFINES \''${INSTALL_DEFINES} -DRELATIVE_LAYER_BINARY=\"\)\(\$<TARGET_FILE_NAME:\''${TARGET_NAME}>\")\)|\1$out/lib/\2|" -i layers/CMakeLists.txt
  -  '';
  +  # Tests require access to vulkan-compatible GPU, which isn't
  +  # available in Nix sandbox. Fails with VK_ERROR_INCOMPATIBLE_DRIVER.
  +  doCheck = false;
   
     meta = with lib; {
       description = "The official Khronos Vulkan validation layers";
  
positive.code:       src = fetchFromGitHub {
          owner = "KhronosGroup";
          repo = "SPIRV-Tools";
          rev = "c9c1f54330d13a0bec1aa3f08d436249d8e35596";
          sha256 = "0r5whsw9x8j4199xwxv293ar2ga73pm2s7rngw732ylh6rw3bkly";
        };
      });
      argSpirv-headers = localSpirvHeaders;
  
negative.code:     src = fetchFromGitHub {
        owner = "KhronosGroup";
        repo = "glslang";
        rev = "e56beaee736863ce48455955158f1839e6e4c1a1";
        sha256 = "062v3zq88dvgpy3xlb86lj4skk9472jh7hv835d8gs8zbyy0s3aw";
      };
    });
    robin-hood-hashing = fetchFromGitHub {
      owner = "martinus";
      repo = "robin-hood-hashing";
      rev = "eee46f9985c3c65a05b35660c6866f8f8f1a3ba3";
      sha256 = "0h2ljqxnc1gr3p3iqk627n65c7pixpzxhd9vaybr24f90f069lmw";
    };
  in
  stdenv.mkDerivation rec {
    pname = "vulkan-validation-layers";
    version = "1.2.176.0";
  
    # If we were to use "dev" here instead of headers, the setupHook would be
    # placed in that output instead of "out".
  