From 2ae131956daa4813ca7e4809c19d4b1937e022a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Fri, 29 Nov 2024 16:45:53 +0100 Subject: [PATCH] move fixup --- overlays/uv/package.nix | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/overlays/uv/package.nix b/overlays/uv/package.nix index 9788b72..ac13963 100644 --- a/overlays/uv/package.nix +++ b/overlays/uv/package.nix @@ -2,6 +2,8 @@ stdenv, versionCheckHook, lib, + installShellFiles, + autoPatchelfHook, }: stdenv.mkDerivation rec { pname = "uv-bin"; @@ -9,9 +11,34 @@ stdenv.mkDerivation rec { src = fetchTarball { 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 = [ versionCheckHook ];