33 buildGoModule ,
44 fetchFromGitHub ,
55 pkg-config ,
6- makeWrapper ,
6+ makeBinaryWrapper ,
77 poppler-utils ,
88 tesseract ,
99 catdoc ,
10+ unrtf ,
1011 python3Packages ,
11- versionCheckHook ,
1212 nix-update-script ,
13+ writableTmpDirAsHomeHook ,
1314} :
1415
15- buildGoModule rec {
16+ buildGoModule ( finalAttrs : {
1617 pname = "rlama" ;
17- version = "0.1.30 " ;
18+ version = "0.1.36 " ;
1819
1920 src = fetchFromGitHub {
2021 owner = "dontizi" ;
2122 repo = "rlama" ;
22- tag = "v${ version } " ;
23- hash = "sha256-J4FTRWQfdmWXMhlwINQgqj7sCvF3+0YZwcZFW8y1CgY =" ;
23+ tag = "v${ finalAttrs . version } " ;
24+ hash = "sha256-SzrnpAkh+SMzF9xOAxZXondRulwPRUZYHrhe3rf06bA =" ;
2425 } ;
2526
26- vendorHash = "sha256-XZVMnkv+WqUqM6jbgrO3P5CSDACH3vLFJ4Y79EOnD08 =" ;
27+ vendorHash = "sha256-GHmLCgL79BdGw/5zz50Y1kR/6JYNalvOj2zjIHQ9IF0 =" ;
2728
2829 env . CGO_ENABLED = "0" ;
2930
@@ -34,28 +35,52 @@ buildGoModule rec {
3435
3536 nativeBuildInputs = [
3637 pkg-config
37- makeWrapper
38+ makeBinaryWrapper
3839 ] ;
3940
41+ # Run only unit tests for core packages; skip e2e tests that require Ollama
42+ checkPhase = ''
43+ runHook preCheck
44+
45+ go test -v ./internal/domain/... ./pkg/vector/... ./internal/repository/...
46+
47+ runHook postCheck
48+ '' ;
49+
4050 postInstall = ''
4151 wrapProgram $out/bin/rlama \
4252 --prefix PATH : ${
4353 lib . makeBinPath [
4454 poppler-utils
4555 tesseract
4656 catdoc
57+ unrtf
4758 python3Packages . pdfminer-six
4859 python3Packages . docx2txt
4960 python3Packages . xlsx2csv
61+ python3Packages . torch
62+ python3Packages . transformers
5063 ]
5164 }
5265 '' ;
5366
5467 nativeInstallCheckInputs = [
55- versionCheckHook
68+ writableTmpDirAsHomeHook
5669 ] ;
57- versionCheckProgramArg = "--version" ;
70+
5871 doInstallCheck = true ;
72+ installCheckPhase = ''
73+ runHook preInstallCheck
74+
75+ VERSION=$($out/bin/rlama --version | grep -o "${ finalAttrs . version } " || true)
76+ if [ -z "$VERSION" ]; then
77+ echo "Version check failed: expected ${ finalAttrs . version } , got: $($out/bin/rlama --version)"
78+ else
79+ echo "$VERSION"
80+ fi
81+
82+ runHook postInstallCheck
83+ '' ;
5984
6085 passthru = {
6186 updateScript = nix-update-script { } ;
@@ -64,9 +89,9 @@ buildGoModule rec {
6489 meta = {
6590 description = "Retrieval-Augmented Language Model Adapter" ;
6691 homepage = "https://github.com/dontizi/rlama" ;
67- changelog = "https://github.com/dontizi/rlama/releases/tag/v${ version } " ;
92+ changelog = "https://github.com/dontizi/rlama/releases/tag/v${ finalAttrs . version } " ;
6893 license = lib . licenses . asl20 ;
6994 maintainers = with lib . maintainers ; [ liberodark ] ;
7095 mainProgram = "rlama" ;
7196 } ;
72- }
97+ } )
0 commit comments