diff --git a/nix/dev-shell.nix b/nix/dev-shell.nix index 7414b816f..b1fdc438d 100644 --- a/nix/dev-shell.nix +++ b/nix/dev-shell.nix @@ -1,72 +1,84 @@ { mkShell , stdenv , lib , amqp-cpp , arcanist +, boost , cargo , cmake , cryptopp , darwin +, folly +, fmt , grpc , libiconv , libuv , nodejs-16_x +, olm +, openssl , pkg-config , protobuf_3_15_cmake , python2 , python3 +, sqlite , watchman , rustfmt , yarn }: mkShell { # programs which are meant to be executed should go here nativeBuildInputs = [ # generic development arcanist # node development nodejs-16_x yarn watchman # react native python2 python3 # native dependencies # C/CXX toolchains are already brought in with mkShell # Identity Service cargo # includes rustc rustfmt # Tunnelbroker + CMake amqp-cpp cryptopp cmake libuv pkg-config protobuf_3_15_cmake grpc ]; # include any libraries buildInputs buildInputs = [ protobuf_3_15_cmake # exposes both a library and a command, thus should appear in both inputs + folly # cpp tools + fmt # needed for folly + boost # needed for folly + olm # needed for CryptoTools + sqlite # needed for sqlite_orm + openssl # needed for grpc ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices Security libiconv # identity service ]); # shell commands to be ran upon entering shell shellHook = '' if [[ "$OSTYPE" == 'linux'* ]]; then export MYSQL_UNIX_PORT=''${XDG_RUNTIME_DIR:-/run/user/$UID}/mysql-socket/mysql.sock fi echo "Welcome to Comm dev environment! :)" ''; } diff --git a/nix/overlay.nix b/nix/overlay.nix index 688fc2bb7..e87b19298 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,29 +1,36 @@ # An overlay allows for a package set to be extended with new or modified packages # `final` refers to the package set with all overlays applied. # This allows for added or modified packages to be referenced with # all relevant changes final: # `prev` refers to the previous package set before this current overlay is applied. # This is cheaper for nix to evaluate, thus should be prefered over final when possible. prev: { # add packages meant for just this repository amqp-cpp = prev.callPackage ./amqp-cpp.nix { }; protobuf_3_15_cmake = prev.callPackage ./protobuf_3_15.nix { }; devShell = final.callPackage ./dev-shell.nix { }; mysql-down = prev.callPackage ./mysql-down-linux.nix { }; mysql-up = prev.callPackage ./mysql-up-linux.nix { }; arcanist = prev.arcanist.override(_: { # php8.1 will cause warnings to throw as exceptions # around calling strlen() with null php = prev.php80; }); + + olm = prev.olm.overrideAttrs(oldAttrs: { + # *.hh files aren't meant to be used externally, so we patch installation to add it + postInstall = '' + cp $NIX_BUILD_TOP/${oldAttrs.src.name}/include/olm/*.h* ''${!outputDev}/include/olm + ''; + }); }