Skip to content

Commit

Permalink
Add Nix flake files
Browse files Browse the repository at this point in the history
  • Loading branch information
rushmorem committed Sep 3, 2022
1 parent 7b510f8 commit 8f24d90
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 8 deletions.
127 changes: 127 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions flake.nix
@@ -0,0 +1,50 @@
{
description = "SurrealDB - a scalable, distributed, collaborative, document-graph database, for the realtime web";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11-small";
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = { self, flake-utils, naersk, nixpkgs, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let

pkgs = (import nixpkgs) {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};

rustLatest = pkgs.rust-bin.stable.latest;

naersk' = pkgs.callPackage naersk {
cargo = rustLatest.default;
rustc = rustLatest.default;
};

in rec {
# For `nix build` & `nix run`:
packages.default = naersk'.buildPackage {
src = ./.;
cargoBuildOptions = options: options ++ [ ''--features "storage-tikv storage-fdb-6_1"'' ];
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ cmake perl protobuf openssl clang fdbPackages.foundationdb61 ];
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
};

# For `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ pkg-config ];
hardeningDisable = [ "fortify" ];
buildInputs = with pkgs; [
cmake perl protobuf openssl clang rust-analyzer
rustLatest.default rustLatest.rustfmt rustLatest.clippy
fdbPackages.foundationdb61
];
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
};
}
);
}
16 changes: 8 additions & 8 deletions lib/Cargo.toml
Expand Up @@ -18,14 +18,14 @@ default = ["parallel", "kv-mem", "kv-rocksdb", "scripting", "http"]
parallel = ["dep:executor"]
kv-tikv = ["dep:tikv"]
kv-fdb = ["kv-fdb-6_3"]
kv-fdb-5_1 = ["foundationdb?/fdb-5_1"]
kv-fdb-5_2 = ["foundationdb?/fdb-5_2"]
kv-fdb-6_0 = ["foundationdb?/fdb-6_0"]
kv-fdb-6_1 = ["foundationdb?/fdb-6_1"]
kv-fdb-6_2 = ["foundationdb?/fdb-6_2"]
kv-fdb-6_3 = ["foundationdb?/fdb-6_3"]
kv-fdb-7_0 = ["foundationdb?/fdb-7_0"]
kv-fdb-7_1 = ["foundationdb?/fdb-7_1"]
kv-fdb-5_1 = ["foundationdb/fdb-5_1"]
kv-fdb-5_2 = ["foundationdb/fdb-5_2"]
kv-fdb-6_0 = ["foundationdb/fdb-6_0"]
kv-fdb-6_1 = ["foundationdb/fdb-6_1"]
kv-fdb-6_2 = ["foundationdb/fdb-6_2"]
kv-fdb-6_3 = ["foundationdb/fdb-6_3"]
kv-fdb-7_0 = ["foundationdb/fdb-7_0"]
kv-fdb-7_1 = ["foundationdb/fdb-7_1"]
kv-mem = ["dep:echodb"]
kv-indxdb = ["dep:indxdb"]
kv-rocksdb = ["dep:rocksdb"]
Expand Down

0 comments on commit 8f24d90

Please sign in to comment.