Skip to content

Commit c78d1f0

Browse files
committed
add hallucinator pkg
1 parent b8e9bca commit c78d1f0

4 files changed

Lines changed: 61 additions & 0 deletions

File tree

flake-packages.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
claude-monitor = pkgs.callPackage ./pkgs/claude-monitor.nix {
4646
inherit (inputs) claude-monitor-src;
4747
};
48+
hallucinator = pkgs.callPackage ./pkgs/hallucinator.nix {
49+
inherit (inputs) hallucinator-src;
50+
};
4851
hifiscan = pkgs.hifiscan.overrideAttrs (final: prev: {
4952
buildInputs = prev.buildInputs ++ [ pkgs.wrapGAppsHook3 pkgs.wrapGAppsHook4 ];
5053
});

flake.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@
146146

147147
claude-monitor-src.url = "github:Maciek-roboblog/Claude-Code-Usage-Monitor";
148148
claude-monitor-src.flake = false;
149+
150+
hallucinator-src.url = "github:gianlucasb/hallucinator";
151+
hallucinator-src.flake = false;
149152
};
150153

151154
outputs = {

pkgs/hallucinator.nix

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
hallucinator-src,
3+
lib,
4+
rustPlatform,
5+
pkg-config,
6+
fontconfig,
7+
}:
8+
9+
rustPlatform.buildRustPackage {
10+
pname = "hallucinator";
11+
version = "0.2.1";
12+
13+
src = hallucinator-src;
14+
sourceRoot = "source/hallucinator-rs";
15+
16+
# no vendor hash to maintain: crate hashes come from the lock file
17+
cargoLock.lockFile = "${hallucinator-src}/hallucinator-rs/Cargo.lock";
18+
19+
nativeBuildInputs = [
20+
rustPlatform.bindgenHook # mupdf-sys generates bindings from vendored mupdf
21+
pkg-config
22+
];
23+
24+
buildInputs = [
25+
fontconfig # yeslogic-fontconfig-sys links the system library
26+
];
27+
28+
# tests query online academic databases (CrossRef, arXiv, DBLP, ...)
29+
doCheck = false;
30+
31+
meta = with lib; {
32+
description = "Detect hallucinated references in academic papers";
33+
homepage = "https://github.com/gianlucasb/hallucinator";
34+
license = licenses.agpl3Plus;
35+
mainProgram = "hallucinator-tui";
36+
platforms = platforms.unix;
37+
};
38+
}

0 commit comments

Comments
 (0)