move fixup

This commit is contained in:
Jakub Kropáček 2024-11-29 16:45:53 +01:00
parent 63f888db9b
commit 2ae131956d

View file

@ -2,6 +2,8 @@
stdenv, stdenv,
versionCheckHook, versionCheckHook,
lib, lib,
installShellFiles,
autoPatchelfHook,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "uv-bin"; pname = "uv-bin";
@ -9,9 +11,34 @@ stdenv.mkDerivation rec {
src = fetchTarball { src = fetchTarball {
url = "https://github.com/astral-sh/uv/releases/download/${version}/uv-x86_64-unknown-linux-gnu.tar.gz"; url = "https://github.com/astral-sh/uv/releases/download/${version}/uv-x86_64-unknown-linux-gnu.tar.gz";
sha256 = ""; sha256 = "1rgqmgj9syjansfmkvg1819i70f41za647izgh5hrvjsmcnm6nk7";
}; };
nativeBuildInputs = [
installShellFiles
autoPatchelfHook
stdenv.cc.cc.lib
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp * $out/bin
runHook postInstall
'';
postInstall = ''
$out/bin/uv --version || echo "Binary execution failed."
export HOME=$TMPDIR
installShellCompletion --cmd uv \
--bash <($out/bin/uv --generate-shell-completion bash) \
--fish <($out/bin/uv --generate-shell-completion fish) \
--zsh <($out/bin/uv --generate-shell-completion zsh)
'';
nativeCheckInputs = [ nativeCheckInputs = [
versionCheckHook versionCheckHook
]; ];