From e80dd2ff31fe6b91814182ac7e26f684c1b7ed70 Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Tue, 29 Jun 2021 08:52:26 -0500 Subject: [PATCH] Factor out `shell-hook-common` --- release.nix | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/release.nix b/release.nix index 7565a55..06aafc7 100644 --- a/release.nix +++ b/release.nix @@ -75,7 +75,7 @@ let allowBroken = true; }; - overlay = pkgsNew: pkgsOld: { + overlay = pkgsNew: pkgsOld: rec { grpc = pkgsNew.callPackage ./nix/grpc.nix { }; @@ -171,7 +171,6 @@ let ); parameterized = pkgsNew.haskell.lib.appendPatch haskellPackagesOld.parameterized ./nix/parameterized.patch; - }; }; @@ -180,6 +179,14 @@ let pkgsNew.pythonPackages.protobuf (oldAttrs : {doCheck = false; doInstallCheck = false;}); + shell-hook-common = + pkgsNew.lib.optionalString pkgsNew.stdenv.isDarwin '' + export DYLD_LIBRARY_PATH=${pkgsNew.grpc}/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH + '' + + pkgsNew.lib.optionalString pkgsNew.stdenv.isLinux '' + export LD_LIBRARY_PATH=${pkgsNew.grpc}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH + ''; + test-grpc-haskell = pkgsNew.mkShell { nativeBuildInputs = [ @@ -201,13 +208,9 @@ let export LD_LIBRARY_PATH=${pkgsNew.grpc}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH ''; - shellHook = (oldAttributes.shellHook or "") + - pkgsNew.lib.optionalString pkgsNew.stdenv.isDarwin '' - export DYLD_LIBRARY_PATH=${pkgsNew.grpc}/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH - '' + - pkgsNew.lib.optionalString pkgsNew.stdenv.isLinux '' - export LD_LIBRARY_PATH=${pkgsNew.grpc}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH - ''; + shellHook = (oldAttributes.shellHook or "") + '' + ${shell-hook-common} + ''; } ); };