overlays #3
5 changed files with 69 additions and 1 deletions
|
@ -43,6 +43,7 @@
|
|||
nixpkgs.lib.nixosSystem {
|
||||
system = arch;
|
||||
modules = [
|
||||
(import ./overlays)
|
||||
./nixosModules
|
||||
./hosts/${host}
|
||||
./hosts/base
|
||||
|
|
|
@ -28,7 +28,7 @@ in
|
|||
python3
|
||||
poetry
|
||||
pre-commit
|
||||
uv
|
||||
uv-bin
|
||||
]
|
||||
++ lib.optionals cfg.install-additional [
|
||||
python313
|
||||
|
|
6
overlays/default.nix
Normal file
6
overlays/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
(import ./uv)
|
||||
];
|
||||
}
|
3
overlays/uv/default.nix
Normal file
3
overlays/uv/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
(final: prev: {
|
||||
uv-bin = prev.callPackage ./package.nix { };
|
||||
})
|
58
overlays/uv/package.nix
Normal file
58
overlays/uv/package.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
stdenv,
|
||||
versionCheckHook,
|
||||
lib,
|
||||
installShellFiles,
|
||||
autoPatchelfHook,
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "uv-bin";
|
||||
version = "0.5.5";
|
||||
|
||||
src = fetchTarball {
|
||||
url = "https://github.com/astral-sh/uv/releases/download/${version}/uv-x86_64-unknown-linux-gnu.tar.gz";
|
||||
sha256 = "1rgqmgj9syjansfmkvg1819i70f41za647izgh5hrvjsmcnm6nk7";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
autoPatchelfHook
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
|
||||
cp * $out/bin
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
dontAutoPatchelf = true;
|
||||
|
||||
postFixup = ''
|
||||
autoPatchelf -- "$out"
|
||||
|
||||
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
|
||||
];
|
||||
versionCheckProgramArg = [ "--version" ];
|
||||
|
||||
meta = {
|
||||
description = "Extremely fast Python package installer and resolver, written in Rust";
|
||||
homepage = "https://github.com/astral-sh/uv";
|
||||
license = with lib.licenses; [
|
||||
asl20
|
||||
mit
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue