diff --git a/build.sbt b/build.sbt index 60c12f45f..70bd51b96 100644 --- a/build.sbt +++ b/build.sbt @@ -942,6 +942,10 @@ lazy val bootstrapped = projectMatrix Compile / PB.protoSources ++= Seq( exampleGeneratedResourcesOutput.value ), + Compile / PB.protocExecutable := sys.env + .get("PROTOC_PATH") + .map(file(_)) + .getOrElse((Compile / PB.protocExecutable).value), Compile / PB.targets := Seq( scalapb.gen() -> (Compile / sourceManaged).value / "scalapb" ), diff --git a/flake.lock b/flake.lock index e0823f3fb..19f639ea5 100644 --- a/flake.lock +++ b/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1663192503, - "narHash": "sha256-vbyobo3DokKs/d4dlp8dIpVi3zYzXl4xo3e8VnY1Bj8=", + "lastModified": 1718110205, + "narHash": "sha256-cv//kqJTOcaL5v3bfU/q+McjzlPikQ9omL3j7qltUsA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "31946d7d94ea25194b8c4c23e5770ec09d42c3d0", + "rev": "8f5f49d8ad22689611fcbb62b1a79124a35cf67d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f40b326b2..f97941baa 100644 --- a/flake.nix +++ b/flake.nix @@ -2,31 +2,32 @@ inputs.nixpkgs.url = "github:nixos/nixpkgs"; inputs.flake-utils.url = "github:numtide/flake-utils"; - outputs = { self, nixpkgs, flake-utils, ... }@inputs: + outputs = { nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; - shellPackages = [ - "jre" - "sbt" - "nodejs-16_x" - "yarn" + shellPackages = with pkgs; [ + temurin-jre-bin-17 + nodejs-18_x + yarn + (pkgs.sbt.override { jre = pkgs.temurin-jre-bin-17; }) ]; + protobuf = pkgs.protobuf3_21; in { devShells.default = pkgs.mkShell { - buildInputs = map (pkgName: pkgs.${pkgName}) shellPackages; - nativeBuildInputs = [ pkgs.openssl pkgs.zlib ]; + buildInputs = shellPackages; + nativeBuildInputs = [ pkgs.openssl pkgs.zlib protobuf ]; welcomeMessage = '' Welcome to the smithy4s Nix shell! 👋 Available packages: - ${builtins.concatStringsSep "\n" (map (n : "- ${n}") shellPackages)} + ${builtins.concatStringsSep "\n" (map (n : "- ${n.name}") shellPackages)} ''; shellHook = '' echo "$welcomeMessage" ''; - LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib"; + PROTOC_PATH = pkgs.lib.getExe protobuf; }; } );