-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
60 lines (54 loc) · 1.55 KB
/
flake.nix
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
{
description = "CozoDB standalone built with Rust-Nightly";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
cozodb = {
type = "git";
url = "https://github.com/cozodb/cozo.git?ref=master";
flake = false;
submodules = true;
};
};
outputs = { self, fenix, flake-utils, nixpkgs, cozodb }:
(flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
toolchain = fenix.packages.${system}.stable.toolchain;
in
{
defaultPackage = (pkgs.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
}).buildRustPackage {
pname = "cozo-bin";
version = builtins.readFile "${cozodb}/VERSION";
src = cozodb;
nativeBuildInputs = [ pkgs.cmake ];
buildInputs = [ pkgs.jemalloc ];
inherit (pkgs.rocksdb) cmakeFlags NIX_CFLAGS_COMPILE;
propagatedBuildInputs = with pkgs; [
bzip2
lz4
snappy
zlib
zstd
];
cargoLock.lockFile = "${cozodb}/Cargo.lock";
buildFeatures = [
"compact"
"requests"
"jemalloc"
"graph-algo"
"storage-rocksdb"
];
__contentAddressed = true;
outputHashAlgo = "sha256";
outputHashMode = "recursive";
};
}));
}