push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
{
lib,
rustPlatform,
fetchFromGitHub,
makeBinaryWrapper,
installShellFiles,
versionCheckHook,
nix-update-script,
}:
let
version = "0.4.2";
in
rustPlatform.buildRustPackage {
pname = "lla";
inherit version;
src = fetchFromGitHub {
owner = "chaqchase";
repo = "lla";
tag = "v${version}";
hash = "sha256-7/VfEcqvYGC1Pw9wJh5FF3c7BXgcg9LVDvcr4zCrros=";
};
nativeBuildInputs = [
makeBinaryWrapper
installShellFiles
];
cargoHash = "sha256-LYRNXNhPgpNZWP5XKqfgM6t9Ts2k/e09iXWMcuEp9LA=";
cargoBuildFlags = [ "--workspace" ];
# TODO: Upstream also provides Elvish and PowerShell completions,
# but `installShellCompletion` only has support for Bash, Zsh and Fish at the moment.
postInstall = ''
installShellCompletion completions/{_lla,lla{.bash,.fish}}
'';
postFixup = ''
wrapProgram $out/bin/lla \
--add-flags "--plugins-dir $out/lib"
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
passthru.updateScript = nix-update-script { };
meta = {
description = "Blazing-fast `ls` replacement with superpowers";
longDescription = ''
`lla` is a modern `ls` replacement that transforms how developers interact with their filesystem.
Built with Rust's performance capabilities and designed with user experience in mind,
`lla` combines the familiarity of ls with powerful features like specialized views,
Git integration, and a robust plugin system with an extensible list of plugins to add more functionality.
'';
homepage = "https://lla.chaqchase.com";
changelog = "https://github.com/chaqchase/lla/blob/refs/tags/v${version}/CHANGELOG.md";
license = with lib.licenses; [ mit ];
maintainers = with lib.maintainers; [ pluiedev ];
platforms = lib.platforms.unix;
mainProgram = "lla";
};
}

View File

@@ -0,0 +1,3 @@
{ llama-cpp }:
llama-cpp.override { rocmSupport = true; }

View File

@@ -0,0 +1,3 @@
{ llama-cpp }:
llama-cpp.override { vulkanSupport = true; }

View File

@@ -0,0 +1,15 @@
index b97e7bf9..9cdc62a4 100644
--- a/ggml/src/ggml-vulkan/CMakeLists.txt
+++ b/ggml/src/ggml-vulkan/CMakeLists.txt
@@ -70,11 +70,5 @@ if (Vulkan_FOUND)
"GGML_VULKAN_INTEGER_DOT_GLSLC_SUPPORT"
)
- test_shader_extension_support(
- "GL_EXT_bfloat16"
- "${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/test_bfloat16_support.comp"
- "GGML_VULKAN_BFLOAT16_GLSLC_SUPPORT"
- )
-
target_link_libraries(ggml-vulkan PRIVATE Vulkan::Vulkan)
target_include_directories(ggml-vulkan PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

View File

@@ -0,0 +1,207 @@
{
lib,
autoAddDriverRunpath,
cmake,
fetchFromGitHub,
nix-update-script,
stdenv,
config,
cudaSupport ? config.cudaSupport,
cudaPackages ? { },
rocmSupport ? config.rocmSupport,
rocmPackages ? { },
rocmGpuTargets ? rocmPackages.clr.localGpuTargets or rocmPackages.clr.gpuTargets,
openclSupport ? false,
clblast,
blasSupport ? builtins.all (x: !x) [
cudaSupport
metalSupport
openclSupport
rocmSupport
vulkanSupport
],
blas,
pkg-config,
metalSupport ? stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 && !openclSupport,
vulkanSupport ? false,
rpcSupport ? false,
apple-sdk_14,
curl,
llama-cpp,
shaderc,
vulkan-headers,
vulkan-loader,
ninja,
git,
}:
let
# It's necessary to consistently use backendStdenv when building with CUDA support,
# otherwise we get libstdc++ errors downstream.
# cuda imposes an upper bound on the gcc version
effectiveStdenv = if cudaSupport then cudaPackages.backendStdenv else stdenv;
inherit (lib)
cmakeBool
cmakeFeature
optionals
optionalString
;
cudaBuildInputs = with cudaPackages; [
cuda_cccl # <nv/target>
# A temporary hack for reducing the closure size, remove once cudaPackages
# have stopped using lndir: https://github.com/NixOS/nixpkgs/issues/271792
cuda_cudart
libcublas
];
rocmBuildInputs = with rocmPackages; [
clr
hipblas
rocblas
];
vulkanBuildInputs = [
shaderc
vulkan-headers
vulkan-loader
];
in
effectiveStdenv.mkDerivation (finalAttrs: {
pname = "llama-cpp";
version = "6670";
src = fetchFromGitHub {
owner = "ggml-org";
repo = "llama.cpp";
tag = "b${finalAttrs.version}";
hash = "sha256-B4Qog7RLcre8KB9N+aVUZSJwlkHIIcCxR8jySoxbXoQ=";
leaveDotGit = true;
postFetch = ''
git -C "$out" rev-parse --short HEAD > $out/COMMIT
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
patches = lib.optionals vulkanSupport [ ./disable_bfloat16.patch ];
postPatch = ''
# Workaround for local-ai package which overrides this package to an older llama-cpp
if [ -f ./ggml/src/ggml-metal.m ]; then
substituteInPlace ./ggml/src/ggml-metal.m \
--replace-fail '[bundle pathForResource:@"ggml-metal" ofType:@"metal"];' "@\"$out/bin/ggml-metal.metal\";"
fi
if [ -f ./ggml/src/ggml-metal/ggml-metal.m ]; then
substituteInPlace ./ggml/src/ggml-metal/ggml-metal.m \
--replace-fail '[bundle pathForResource:@"ggml-metal" ofType:@"metal"];' "@\"$out/bin/ggml-metal.metal\";"
fi
'';
nativeBuildInputs = [
cmake
ninja
pkg-config
git
]
++ optionals cudaSupport [
cudaPackages.cuda_nvcc
autoAddDriverRunpath
];
buildInputs =
optionals cudaSupport cudaBuildInputs
++ optionals openclSupport [ clblast ]
++ optionals rocmSupport rocmBuildInputs
++ optionals blasSupport [ blas ]
++ optionals vulkanSupport vulkanBuildInputs
++ optionals metalSupport [ apple-sdk_14 ]
++ [ curl ];
preConfigure = ''
prependToVar cmakeFlags "-DLLAMA_BUILD_COMMIT:STRING=$(cat COMMIT)"
'';
cmakeFlags = [
# -march=native is non-deterministic; override with platform-specific flags if needed
(cmakeBool "GGML_NATIVE" false)
(cmakeBool "LLAMA_BUILD_EXAMPLES" false)
(cmakeBool "LLAMA_BUILD_SERVER" true)
(cmakeBool "LLAMA_BUILD_TESTS" (finalAttrs.finalPackage.doCheck or false))
(cmakeBool "LLAMA_CURL" true)
(cmakeBool "BUILD_SHARED_LIBS" true)
(cmakeBool "GGML_BLAS" blasSupport)
(cmakeBool "GGML_CLBLAST" openclSupport)
(cmakeBool "GGML_CUDA" cudaSupport)
(cmakeBool "GGML_HIP" rocmSupport)
(cmakeBool "GGML_METAL" metalSupport)
(cmakeBool "GGML_RPC" rpcSupport)
(cmakeBool "GGML_VULKAN" vulkanSupport)
(cmakeFeature "LLAMA_BUILD_NUMBER" finalAttrs.version)
]
++ optionals cudaSupport [
(cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString)
]
++ optionals rocmSupport [
(cmakeFeature "CMAKE_HIP_COMPILER" "${rocmPackages.clr.hipClangPath}/clang++")
(cmakeFeature "CMAKE_HIP_ARCHITECTURES" (builtins.concatStringsSep ";" rocmGpuTargets))
]
++ optionals metalSupport [
(cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1")
(cmakeBool "LLAMA_METAL_EMBED_LIBRARY" true)
]
++ optionals rpcSupport [
# This is done so we can move rpc-server out of bin because llama.cpp doesn't
# install rpc-server in their install target.
(cmakeBool "CMAKE_SKIP_BUILD_RPATH" true)
];
# upstream plans on adding targets at the cmakelevel, remove those
# additional steps after that
postInstall = ''
# Match previous binary name for this package
ln -sf $out/bin/llama-cli $out/bin/llama
mkdir -p $out/include
cp $src/include/llama.h $out/include/
''
+ optionalString rpcSupport "cp bin/rpc-server $out/bin/llama-rpc-server";
# the tests are failing as of 2025-08
doCheck = false;
passthru = {
tests = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
metal = llama-cpp.override { metalSupport = true; };
};
updateScript = nix-update-script {
attrPath = "llama-cpp";
extraArgs = [
"--version-regex"
"b(.*)"
];
};
};
meta = {
description = "Inference of Meta's LLaMA model (and others) in pure C/C++";
homepage = "https://github.com/ggml-org/llama.cpp";
license = lib.licenses.mit;
mainProgram = "llama";
maintainers = with lib.maintainers; [
booxter
dit7ya
philiptaron
xddxdd
];
platforms = lib.platforms.unix;
badPlatforms = optionals (cudaSupport || openclSupport) lib.platforms.darwin;
broken = metalSupport && !effectiveStdenv.hostPlatform.isDarwin;
};
})

View File

@@ -0,0 +1,120 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
versionCheckHook,
callPackage,
nixosTests,
}:
let
canExecute = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
in
buildGoModule (finalAttrs: {
pname = "llama-swap";
version = "156";
src = fetchFromGitHub {
owner = "mostlygeek";
repo = "llama-swap";
tag = "v${finalAttrs.version}";
hash = "sha256-z0262afVjsdGe6WPoWO1wbccLO538fXBuxOOqLnJHRU=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
postFetch = ''
cd "$out"
git rev-parse HEAD > $out/COMMIT
# '0000-00-00T00:00:00Z'
date -u -d "@$(git log -1 --pretty=%ct)" "+'%Y-%m-%dT%H:%M:%SZ'" > $out/SOURCE_DATE_EPOCH
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
vendorHash = "sha256-5mmciFAGe8ZEIQvXejhYN+ocJL3wOVwevIieDuokhGU=";
passthru.ui = callPackage ./ui.nix { llama-swap = finalAttrs.finalPackage; };
passthru.npmDepsHash = "sha256-Sbvz3oudMVf+PxOJ6s7LsDaxFwvftNc8ZW5KPpbI/cA=";
nativeBuildInputs = [
versionCheckHook
];
ldflags = [
"-s"
"-w"
"-X main.version=${finalAttrs.version}"
];
preBuild = ''
# ldflags based on metadata from git and source
ldflags+=" -X main.commit=$(cat COMMIT)"
ldflags+=" -X main.date=$(cat SOURCE_DATE_EPOCH)"
# copy for go:embed in proxy/ui_embed.go
cp -r ${finalAttrs.passthru.ui}/ui_dist proxy/
'';
excludedPackages = [
# regression testing tool
"misc/process-cmd-test"
# benchmark/regression testing tool
"misc/benchmark-chatcompletion"
]
++ lib.optionals (!canExecute) [
# some tests expect to execute `simple-something`; if it can't be executed
# it's unneeded
"misc/simple-responder"
];
# some tests expect to execute `simple-something` and proxy/helpers_test.go
# checks the file exists
doCheck = canExecute;
preCheck = ''
mkdir build
ln -s "$GOPATH/bin/simple-responder" "./build/simple-responder_''${GOOS}_''${GOARCH}"
'';
postCheck = ''
rm "$GOPATH/bin/simple-responder"
'';
preInstall = ''
install -Dm444 -t "$out/share/llama-swap" config.example.yaml
'';
doInstallCheck = true;
versionCheckProgramArg = "-version";
passthru.tests.nixos = nixosTests.llama-swap;
meta = {
homepage = "https://github.com/mostlygeek/llama-swap";
changelog = "https://github.com/mostlygeek/llama-swap/releases/tag/${finalAttrs.src.tag}";
description = "Model swapping for llama.cpp (or any local OpenAPI compatible server)";
longDescription = ''
llama-swap is a light weight, transparent proxy server that provides
automatic model swapping to llama.cpp's server.
When a request is made to an OpenAI compatible endpoint, llama-swap will
extract the `model` value and load the appropriate server configuration to
serve it. If the wrong upstream server is running, it will be replaced
with the correct one. This is where the "swap" part comes in. The upstream
server is automatically swapped to the correct one to serve the request.
In the most basic configuration llama-swap handles one model at a time.
For more advanced use cases, the `groups` feature allows multiple models
to be loaded at the same time. You have complete control over how your
system resources are used.
'';
license = lib.licenses.mit;
mainProgram = "llama-swap";
maintainers = with lib.maintainers; [
jk
podium868909
];
};
})

View File

@@ -0,0 +1,26 @@
{
llama-swap,
buildNpmPackage,
}:
buildNpmPackage (finalAttrs: {
pname = "${llama-swap.pname}-ui";
inherit (llama-swap) version src npmDepsHash;
postPatch = ''
substituteInPlace vite.config.ts \
--replace-fail "../proxy/ui_dist" "${placeholder "out"}/ui_dist"
'';
sourceRoot = "${finalAttrs.src.name}/ui";
# bundled "ui_dist" doesn't need node_modules
postInstall = ''
rm -rf $out/lib
'';
meta = (removeAttrs llama-swap.meta [ "mainProgram" ]) // {
description = "${llama-swap.meta.description} - UI";
};
})

View File

@@ -0,0 +1,78 @@
{
stdenv,
lib,
fetchFromGitHub,
bash,
coreutils,
gnugrep,
gnused,
jq,
lldap,
unixtools,
curl,
makeWrapper,
unstableGitUpdater,
}:
stdenv.mkDerivation {
pname = "lldap-cli";
version = "0-unstable-2025-01-19";
src = fetchFromGitHub {
owner = "Zepmann";
repo = "lldap-cli";
rev = "e383494b4dd89ae4e028958b268e200fd85a7a64";
hash = "sha256-k6UDLOyP+EvKmC1TmbMObgAw2IIs7ekIZxJOWbwc+jg=";
};
nativeBuildInputs = [ makeWrapper ];
patchPhase = ''
runHook prePatch
# fix .lldap-cli-wrapped showing up in usage
substituteInPlace lldap-cli \
--replace-fail '$(basename $0)' lldap-cli
runHook postPatch
'';
dontConfigure = true;
dontBuild = true;
installPhase = ''
install -Dm555 lldap-cli -t $out/bin
wrapProgram $out/bin/lldap-cli \
--prefix PATH : ${
lib.makeBinPath [
bash
unixtools.column
coreutils
gnugrep
gnused
jq
lldap # Needed for lldap_set_password
curl
]
}
'';
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Command line tool for managing LLDAP";
longDescription = ''
LDAP-CLI is a command line interface for LLDAP.
LLDAP uses GraphQL to offer an HTTP-based API.
This API is used by an included web-based user interface.
Unfortunately, LLDAP lacks a command-line interface,
which is a necessity for any serious administrator.
LLDAP-CLI translates CLI commands to GraphQL API calls.
'';
homepage = "https://github.com/Zepmann/lldap-cli";
license = lib.licenses.gpl3Only;
maintainers = [ lib.maintainers.nw ];
mainProgram = "lldap-cli";
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,133 @@
{
binaryen,
fetchFromGitHub,
lib,
lldap,
makeWrapper,
nixosTests,
rustPlatform,
rustc,
wasm-bindgen-cli_0_2_100,
wasm-pack,
which,
runCommand,
cacert,
curl,
staticAssetsHash ? "sha256-xVbHD9s3ofbtHCDvjYwmsWXDEJ9z9vRxQDRR6pW6rt8=",
}:
let
version = "0.6.2";
commonDerivationAttrs = {
pname = "lldap";
inherit version;
src = fetchFromGitHub {
owner = "lldap";
repo = "lldap";
rev = "v${version}";
hash = "sha256-UBQWOrHika8X24tYdFfY8ETPh9zvI7/HV5j4aK8Uq+Y=";
};
cargoHash = "sha256-SO7+HiiXNB/KF3fjzSMeiTPjRQq/unEfsnplx4kZv9c=";
};
staticAssets =
src:
runCommand "${commonDerivationAttrs.pname}-static-assets"
{
outputHash = staticAssetsHash;
outputHashAlgo = "sha256";
outputHashMode = "recursive";
inherit src;
nativeBuildInputs = [
curl
];
env.SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
}
''
mkdir $out
mkdir $out/fonts
for file in $(cat ${src}/app/static/libraries.txt); do
curl $file --location --remote-name --output-dir $out
done
for file in $(cat ${src}/app/static/fonts/fonts.txt); do
curl $file --location --remote-name --output-dir $out/fonts
done
'';
frontend = rustPlatform.buildRustPackage (
finalAttrs:
commonDerivationAttrs
// {
pname = commonDerivationAttrs.pname + "-frontend";
nativeBuildInputs = [
wasm-pack
wasm-bindgen-cli_0_2_100
binaryen
which
rustc
rustc.llvmPackages.lld
];
buildPhase = ''
HOME=`pwd` ./app/build.sh
'';
installPhase = ''
mkdir -p $out
cp -R app/{pkg,static} $out/
cp app/index_local.html $out/index.html
cp -R ${staticAssets finalAttrs.src}/* $out/static
rm $out/static/libraries.txt $out/static/fonts/fonts.txt
'';
doCheck = false;
}
);
in
rustPlatform.buildRustPackage (
commonDerivationAttrs
// {
cargoBuildFlags = [
"-p"
"lldap"
"-p"
"lldap_migration_tool"
"-p"
"lldap_set_password"
];
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
wrapProgram $out/bin/lldap \
--set LLDAP_ASSETS_PATH ${frontend}
'';
passthru = {
inherit frontend;
tests = {
inherit (nixosTests) lldap;
};
};
meta = with lib; {
description = "Lightweight authentication server that provides an opinionated, simplified LDAP interface for authentication";
homepage = "https://github.com/lldap/lldap";
changelog = "https://github.com/lldap/lldap/blob/v${lldap.version}/CHANGELOG.md";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = with maintainers; [
bendlas
ibizaman
];
mainProgram = "lldap";
};
}
)

View File

@@ -0,0 +1,71 @@
{
stdenv,
fetchurl,
lib,
libevent,
net-snmp,
openssl,
pkg-config,
readline,
removeReferencesTo,
}:
stdenv.mkDerivation rec {
pname = "lldpd";
version = "1.0.20";
src = fetchurl {
url = "https://media.luffy.cx/files/lldpd/${pname}-${version}.tar.gz";
hash = "sha256-YbjLItSHnmj3glovuOHpKrtKukdzl3zwJYvDLtn1VFA=";
};
configureFlags = [
"--localstatedir=/var"
"--enable-pie"
"--with-snmp"
"--with-systemdsystemunitdir=\${out}/lib/systemd/system"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"--with-launchddaemonsdir=no"
"--with-privsep-chroot=/var/empty"
"--with-privsep-group=nogroup"
"--with-privsep-user=nobody"
];
nativeBuildInputs = [
pkg-config
removeReferencesTo
];
buildInputs = [
libevent
readline
net-snmp
openssl
];
preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
# Yes, this works and is required for cross :'/
export PATH=$PATH:${net-snmp.dev}/bin
'';
enableParallelBuilding = true;
outputs = [
"out"
"dev"
"man"
"doc"
];
preFixup = ''
find $out -type f -exec remove-references-to -t ${stdenv.cc} '{}' +
'';
meta = with lib; {
description = "802.1ab implementation (LLDP) to help you locate neighbors of all your equipments";
homepage = "https://lldpd.github.io/";
license = licenses.isc;
maintainers = with maintainers; [ fpletz ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,56 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
nix-update-script,
testers,
python3,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "llhttp";
version = "9.3.0";
src = fetchFromGitHub {
owner = "nodejs";
repo = "llhttp";
tag = "release/v${finalAttrs.version}";
hash = "sha256-VL58h8sdJIpzMiWNqTvfp8oITjb0b3X/F8ygaE9cH94=";
};
outputs = [
"out"
"dev"
];
nativeBuildInputs = [
cmake
];
cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic)
];
passthru.updateScript = nix-update-script {
extraArgs = [ "--version-regex=release/v(.+)" ];
};
passthru.tests = {
inherit (python3.pkgs) aiohttp;
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
moduleNames = [ "libllhttp" ];
};
};
meta = {
description = "Port of http_parser to llparse";
homepage = "https://llhttp.org/";
changelog = "https://github.com/nodejs/llhttp/releases/tag/release/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ aduh95 ];
platforms = lib.platforms.all;
};
})

View File

@@ -0,0 +1,97 @@
From cb0a3da737d933614bcd011e91048f2009036d09 Mon Sep 17 00:00:00 2001
From: a-kenji <aks.kenji@protonmail.com>
Date: Wed, 14 Aug 2024 09:29:18 +0200
Subject: [PATCH] Fix `time` compilation failure
This allows `llm-ls` to be compiled with `rustc --version`: 1.80, using
the Cargo.lock file.
Reference: https://github.com/rust-lang/rust/issues/127343
---
Cargo.lock | 34 ++++++++++++++++++++++++++--------
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 1806f0be28f65ab1283954c5a72ae20594044624..e8328e602e50fd5e47ba55c5dc9c7881a308a0a5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -487,9 +487,12 @@ dependencies = [
[[package]]
name = "deranged"
-version = "0.3.8"
+version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946"
+checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
+dependencies = [
+ "powerfmt",
+]
[[package]]
name = "derive_builder"
@@ -1210,6 +1213,12 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "num-conv"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
+
[[package]]
name = "num_cpus"
version = "1.16.0"
@@ -1403,6 +1412,12 @@ version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
+[[package]]
+name = "powerfmt"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
+
[[package]]
name = "ppv-lite86"
version = "0.2.17"
@@ -2033,12 +2048,14 @@ dependencies = [
[[package]]
name = "time"
-version = "0.3.28"
+version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48"
+checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [
"deranged",
"itoa",
+ "num-conv",
+ "powerfmt",
"serde",
"time-core",
"time-macros",
@@ -2046,16 +2063,17 @@ dependencies = [
[[package]]
name = "time-core"
-version = "0.1.1"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
+checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]]
name = "time-macros"
-version = "0.2.14"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572"
+checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
dependencies = [
+ "num-conv",
"time-core",
]

View File

@@ -0,0 +1,57 @@
{
lib,
rustPlatform,
fetchFromGitHub,
fetchpatch,
pkg-config,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "llm-ls";
version = "0.5.3";
src = fetchFromGitHub {
owner = "huggingface";
repo = "llm-ls";
tag = version;
hash = "sha256-ICMM2kqrHFlKt2/jmE4gum1Eb32afTJkT3IRoqcjJJ8=";
};
cargoPatches = [
# https://github.com/huggingface/llm-ls/pull/102
./fix-time-compilation-failure.patch
(fetchpatch {
name = "fix-version.patch";
url = "https://github.com/huggingface/llm-ls/commit/479401f3a5173f2917a888c8068f84e29b7dceed.patch?full_index=1";
hash = "sha256-4gXasfMqlrrP8II+FiV/qGfO7a9qFkDQMiax7yEua5E=";
})
];
cargoHash = "sha256-qiYspv2KcvzxVshVpAMlSqFDqbbiutpLyWMz+QSIVmQ=";
buildAndTestSubdir = "crates/llm-ls";
nativeBuildInputs = [ pkg-config ];
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "LSP server leveraging LLMs for code completion (and more?)";
homepage = "https://github.com/huggingface/llm-ls";
changelog = "https://github.com/huggingface/llm-ls/releases/tag/${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ jfvillablanca ];
platforms = lib.platforms.all;
mainProgram = "llm-ls";
};
}

View File

@@ -0,0 +1,46 @@
# The `...` allows this derivation to be overridden with `enable-<llm-plugin>`.
#
# Example:
#
# ```nix
# llm.override {
# enable-llm-anthropic = true;
# enable-llm-gemini = true;
# enable-llm-cmd = true;
# enable-llm-templates-github = true;
# }
# ```
#
# Whatever names are accepted by `llm.withPlugins` are accepted with an added `enable-` prefix as
# an override of this derivation. The user can also do `llm.withPlugins { llm-anthropic = true; }`.
{ lib, python3Packages, ... }@args:
let
inherit (python3Packages) llm;
hasEnablePrefix = lib.hasPrefix "enable-";
addEnablePrefix = name: "enable-${name}";
removeEnablePrefix = lib.removePrefix "enable-";
# Filter to just the attributes which are named "enable-<plugin-name>"
enableArgs = lib.filterAttrs (name: value: hasEnablePrefix name) args;
pluginArgs = lib.mapAttrs' (
name: value: lib.nameValuePair (removeEnablePrefix name) value
) enableArgs;
# Provide some diagnostics for the plugin names
pluginNames = lib.attrNames (lib.functionArgs llm.withPlugins);
enableNames = lib.map addEnablePrefix pluginNames;
unknownPluginNames = lib.removeAttrs pluginArgs pluginNames;
unknownNames = lib.map addEnablePrefix (lib.attrNames unknownPluginNames);
unknownNamesDiagnostic = ''
Unknown plugins specified in override: ${lib.concatStringsSep ", " unknownNames}
Valid overrides:
- ${lib.concatStringsSep "\n - " enableNames}
'';
in
assert lib.assertMsg (lib.length unknownNames == 0) unknownNamesDiagnostic;
llm.withPlugins pluginArgs

View File

@@ -0,0 +1,98 @@
{
stdenv,
lib,
makeWrapper,
fetchFromGitHub,
ocaml,
pkg-config,
mupdf,
libX11,
jbig2dec,
openjpeg,
libjpeg,
lcms2,
harfbuzz,
libGLU,
libGL,
gumbo,
freetype,
zlib,
xclip,
inotify-tools,
procps,
}:
assert lib.versionAtLeast (lib.getVersion ocaml) "4.07";
stdenv.mkDerivation rec {
pname = "llpp";
version = "42";
src = fetchFromGitHub {
owner = "criticic";
repo = "llpp";
rev = "v${version}";
hash = "sha256-B/jKvBtBwMOErUVmGFGXXIT8FzMl1DFidfDCHIH41TU=";
};
postPatch = ''
sed -i "2d;s/ver=.*/ver=${version}/" build.bash
'';
strictDeps = true;
nativeBuildInputs = [
makeWrapper
ocaml
pkg-config
];
buildInputs = [
mupdf
libX11
freetype
zlib
gumbo
jbig2dec
openjpeg
libjpeg
lcms2
harfbuzz
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libGLU
libGL
];
dontStrip = true;
buildPhase = ''
bash ./build.bash build
'';
installPhase = ''
install -d $out/bin
install build/llpp $out/bin
install misc/llpp.inotify $out/bin/llpp.inotify
install -Dm444 misc/llpp.desktop -t $out/share/applications
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
wrapProgram $out/bin/llpp \
--prefix PATH ":" "${xclip}/bin"
wrapProgram $out/bin/llpp.inotify \
--prefix PATH ":" "$out/bin" \
--prefix PATH ":" "${inotify-tools}/bin" \
--prefix PATH ":" "${procps}/bin"
'';
meta = with lib; {
homepage = "https://github.com/criticic/llpp";
description = "MuPDF based PDF pager written in OCaml";
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ pSub ];
license = [
licenses.publicDomain
licenses.bsd3
];
};
}

View File

@@ -0,0 +1,30 @@
{
rustPlatform,
fetchFromGitHub,
lib,
}:
rustPlatform.buildRustPackage rec {
pname = "lls";
version = "0.4.2";
src = fetchFromGitHub {
owner = "jcaesar";
repo = "lls";
tag = "v${version}";
hash = "sha256-eFGyrGtH57a5iRWHWqt1h58QMdmPf2rPqHnuVj5u6PQ=";
};
cargoHash = "sha256-TY7s0sIeW+FgxqbbYvK3uZ2RwPLVKKhLq3DOurer+Gc=";
meta = with lib; {
description = "Tool to list listening sockets";
license = licenses.mit;
maintainers = [
maintainers.k900
maintainers.jcaesar
];
platforms = platforms.linux;
homepage = "https://github.com/jcaesar/lls";
mainProgram = "lls";
};
}