{ lib, stdenv, postgresql, makeBinaryWrapper }: stdenv.mkDerivation rec { name = "temp-postgres-${version}"; version = "0.1"; src = ./.; nativeBuildInputs = [ makeBinaryWrapper ]; buildInputs = [ postgresql ]; installPhase = '' mkdir -p $out/bin cp temp-postgres.sh $out/bin/temp-postgres mkdir -p $out/man/man1 cp temp-postgres.1 $out/man/man1/temp-postgres.1 wrapProgram $out/bin/temp-postgres --prefix PATH : ${lib.makeBinPath [ postgresql ]} ''; }