Skip to content

Commit

Permalink
feat: add nix derivation (#2727)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoog authored Mar 19, 2024
1 parent 29fcd78 commit 9ffc15f
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
61 changes: 61 additions & 0 deletions flake.lock

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

46 changes: 46 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
description = "A fast SQL database for running analytics across distributed data";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version;
in
{
formatter = pkgs.nixpkgs-fmt;
packages.default = pkgs.rustPlatform.buildRustPackage {
name = "glaredb";
version = "${version}-${self.shortRev or "dirty"}";
src = ./.;
doCheck = false;
nativeBuildInputs = with pkgs; [ protobuf ];
buildAndTestSubdir = "crates/glaredb";
preBuild = ''
export PROTOC=${pkgs.protobuf}/bin/protoc
'';
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"bigquery-storage-0.1.2" = "sha256-o23/ALoVtE7SqJsxmXQnykxzqrVZ+Se/gXFYIlIskkI=";
"deltalake-0.17.0" = "sha256-p+k/MXimI7HDGvmrk6WMNhf2MbLrG7B9RlESSyhV04o=";
"lance-0.9.12" = "sha256-vWyXxoRDStvbToubciQSQgl/PErmM333UUGDsjhgr0k=";
};
};
meta = with pkgs.lib; {
description = "A fast SQL database for running analytics across distributed data";
homepage = "https://github.com/glaredb/glaredb";
license = licenses.agpl3;
};
};
devShells.default = with pkgs; mkShell {
packages = [ cargo rustc rust-analyzer rustfmt ];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
}
);
}

0 comments on commit 9ffc15f

Please sign in to comment.