overlays #3

Merged
JustScreaMy merged 4 commits from overlays into master 2024-11-29 20:46:45 +01:00
5 changed files with 69 additions and 1 deletions

View file

@ -43,6 +43,7 @@
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
system = arch; system = arch;
modules = [ modules = [
(import ./overlays)
./nixosModules ./nixosModules
./hosts/${host} ./hosts/${host}
./hosts/base ./hosts/base

View file

@ -28,7 +28,7 @@ in
python3 python3
poetry poetry
pre-commit pre-commit
uv uv-bin
] ]
++ lib.optionals cfg.install-additional [ ++ lib.optionals cfg.install-additional [
python313 python313

6
overlays/default.nix Normal file
View file

@ -0,0 +1,6 @@
{ ... }:
{
nixpkgs.overlays = [
(import ./uv)
];
}

3
overlays/uv/default.nix Normal file
View file

@ -0,0 +1,3 @@
(final: prev: {
uv-bin = prev.callPackage ./package.nix { };
})

58
overlays/uv/package.nix Normal file
View 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
];
};
}