Files
nixpkgs/pkgs/by-name/li/librechat/package.nix
Dark Steveneq 646b892680
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
push sheeet
2025-10-09 14:15:47 +02:00

74 lines
2.0 KiB
Nix

{
lib,
buildNpmPackage,
fetchFromGitHub,
pkg-config,
node-gyp,
vips,
nix-update-script,
}:
buildNpmPackage rec {
pname = "librechat";
version = "0.7.8";
src = fetchFromGitHub {
owner = "danny-avila";
repo = "LibreChat";
tag = "v${version}";
hash = "sha256-bo26EzpRjE2hbbx6oUo0tDsLMdVpWcazCIzA5sm5L34=";
};
patches = [
# `buildNpmPackage` relies on `npm pack`, which only includes files explicitly
# listed in the project's package.json `files` array if this property is set.
# LibreChat does not set this property, but we can avoid packaging the whole
# workspace by simply adding the relevant paths here ourselves.
# Also, we set the `bin` property to the server script to benefit from the
# auto-generated wrapper.
./0001-npm-pack.patch
# LibreChat tries writing logs to the package directory, which is immutable
# in our case. We patch the log directory to target the current working directory
# instead, which in case of NixOS will be the service's data directory.
./0002-logs.patch
# Similarly to the logs, user uploads are by default written to the package
# directory as well. Again, we patch this to be relative to the current working
# directory instead.
./0003-upload-paths.patch
];
npmDepsHash = "sha256-knmS2I6AiSdV2bSnNBThbVHdkpk6iXiRuk4adciDK1M=";
nativeBuildInputs = [
pkg-config
node-gyp
];
buildInputs = [
vips
];
# required for sharp
makeCacheWritable = true;
npmBuildScript = "frontend";
npmPruneFlags = [ "--omit=dev" ];
passthru = {
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"^v(\\d+\\.\\d+\\.\\d+)$"
];
};
};
meta = {
description = "Open-source app for all your AI conversations, fully customizable and compatible with any AI provider";
homepage = "https://github.com/danny-avila/LibreChat";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ niklaskorz ];
mainProgram = "librechat-server";
};
}