forked from surrealdb/surrealdb
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes surrealdb#97
- Loading branch information
Showing
3 changed files
with
185 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
}; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters