Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
83 lines (76 loc) · 2.61 KB
/
Copy pathflake.nix
File metadata and controls
83 lines (76 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
description = "XERJ: the search engine for AI agents";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
workspace = (builtins.fromTOML (builtins.readFile ./engine/Cargo.toml)).workspace.package;
in
{
packages = forAllSystems (pkgs: {
default = self.packages.${pkgs.stdenv.hostPlatform.system}.xerj;
xerj = pkgs.rustPlatform.buildRustPackage {
pname = "xerj";
inherit (workspace) version;
# The engine, and the Console assets that xerj-console-api's build
# script embeds from ../../../xerj-ux. Nothing else, so an edit to
# the docs or the site does not rebuild the binary.
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./engine
./xerj-ux
];
};
cargoRoot = "engine";
buildAndTestSubdir = "engine";
cargoLock.lockFile = ./engine/Cargo.lock;
cargoBuildFlags = [
"-p"
"xerj-server"
"--bin"
"xerj"
];
# The vendored OpenSSL (openssl-src) is built with perl and make.
nativeBuildInputs = [ pkgs.perl ];
# The workspace suite binds ports, starts nodes and runs for a long
# time; CI runs it. The package check is the binary answering below.
doCheck = false;
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/xerj --version
runHook postInstallCheck
'';
meta = {
description = "Search engine for AI agents: one local binary that indexes code, docs and logs and serves an Elasticsearch-compatible API and an MCP server";
homepage = "https://xerj.org";
license = pkgs.lib.licenses.asl20;
mainProgram = "xerj";
platforms = systems;
};
};
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = [
pkgs.cargo
pkgs.rustc
pkgs.rustfmt
pkgs.clippy
pkgs.rust-analyzer
pkgs.perl
];
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
};
});
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
};
}