diff --git a/nix/blob.nix b/nix/blob.nix new file mode 100644 --- /dev/null +++ b/nix/blob.nix @@ -0,0 +1,34 @@ +{ stdenv +, lib +, rustPlatform +, fetchFromGitHub +, protobuf_3_15_cmake +, darwin +}: + +rustPlatform.buildRustPackage rec { + pname = "blob"; + version = "0.0.1"; + + src = ../services/blob; + + cargoLock.lockFile = ../services/blob/Cargo.lock; + + prePatch = '' + mkdir ../../shared + cp -r ${../shared/protos} ../../shared/protos + ''; + + nativeBuildInputs = [ + protobuf_3_15_cmake + ]; + + buildInputs = lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Security + darwin.libiconv + ]; + + meta = with lib; { + license = licenses.bsd3; + }; +} diff --git a/nix/overlay.nix b/nix/overlay.nix --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -49,6 +49,8 @@ nativeBuildInputs = (o.nativeBuildInputs or []) ++ [ prev.cmake ]; }); + comm-blob = final.callPackage ./blob.nix { }; + protobuf_3_15_cmake = prev.callPackage ./protobuf_3_15.nix { }; devShells.default = final.callPackage ./dev-shell.nix { };