diff --git a/pkgs/tools/system/osquery/default.nix b/pkgs/tools/system/osquery/default.nix index e97e03180d32..b887c6e97a21 100644 --- a/pkgs/tools/system/osquery/default.nix +++ b/pkgs/tools/system/osquery/default.nix @@ -14,7 +14,6 @@ , jq , removeReferencesTo , nixosTests -, file , writers }: @@ -24,7 +23,7 @@ let opensslSrc = fetchurl info.openssl; - toolchain = import ./toolchain-bin.nix { inherit stdenv lib fetchzip file; }; + toolchain = import ./toolchain-bin.nix { inherit stdenv lib fetchzip autoPatchelfHook; }; in diff --git a/pkgs/tools/system/osquery/toolchain-bin.nix b/pkgs/tools/system/osquery/toolchain-bin.nix index dd1ff9264d3c..d2fed973fe42 100644 --- a/pkgs/tools/system/osquery/toolchain-bin.nix +++ b/pkgs/tools/system/osquery/toolchain-bin.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchzip, file }: +{ stdenv, lib, fetchzip, autoPatchelfHook }: let version = "1.1.0"; @@ -24,24 +24,13 @@ stdenv.mkDerivation { src = fetchzip dist.${stdenv.hostPlatform.system}; - nativeBuildInputs = [ file ]; + nativeBuildInputs = [ autoPatchelfHook ]; installPhase = '' mkdir $out cp -r * $out ''; - # autoPatchelfHook cannot be used here because of https://github.com/NixOS/nixpkgs/issues/333710 - postFixup = '' - read -r interpreter < "$NIX_BINTOOLS"/nix-support/dynamic-linker - for file in $(find "$out"/usr/bin -type f -executable); do - if [[ $(file "$file") == *ELF*dynamically* ]]; then - patchelf --interpreter "$interpreter" "$file" - patchelf --set-rpath "$out/usr/lib" "$file" - fi - done - ''; - meta = with lib; { description = "A LLVM-based toolchain for Linux designed to build a portable osquery"; homepage = "https://github.com/osquery/osquery-toolchain";