on iko/ghcjs-patch-master help sign in
x509-system: use /usr/bin/security on macOS. (#974)

This mirrors the workaround in nixpkgs for haskellPackages. ref: https://github.com/NixOS/nixpkgs/pull/47676

commitc9dde4d9f4ad8eeaa117522563bdec0a4ff5a353 authorDrew Hess <web-github@drewhess.com> dateWed 16 Dec 2020, 16:00 (6 years ago) parent5e48a60
2 files changed+23−3
overlays/darwin.nix+21−3 overlays/default.nix+2
overlays/darwin.nix+21−3
@@ -1,3 +1,21 @@
1−final: prev: {
2−
3−}
1+final: prev:
2+{
3+ haskell-nix = prev.haskell-nix // ({
4+ defaultModules = prev.haskell-nix.defaultModules ++ [
5+ ({ pkgs, buildModules, config, lib, ... }:
6+ {
7+ packages = { } // pkgs.lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && !pkgs.stdenv.cc.nativeLibc)
8+ {
9+ # Workaround for broken nixpkgs darwin.security_tool in
10+ # Mojave. This mirrors the workaround in nixpkgs
11+ # haskellPackages.
12+ #
13+ # ref:
14+ # https://github.com/NixOS/nixpkgs/pull/47676
15+ # https://github.com/NixOS/nixpkgs/issues/45042
16+ x509-system.components.library.preBuild = "substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security";
17+ };
18+ })
19+ ];
20+ });
21+}
overlays/default.nix+2
@@ -10,6 +10,7 @@ let
1010 bootstrap = import ./bootstrap.nix;
1111 ghc = import ./ghc.nix;
1212 ghc-packages = import ./ghc-packages.nix;
13+ darwin = import ./darwin.nix;
1314 windows = import ./windows.nix;
1415 armv6l-linux = import ./armv6l-linux.nix;
1516 musl = import ./musl.nix;
@@ -42,6 +43,7 @@ let
4243 bootstrap
4344 ghc
4445 ghc-packages
46+ darwin
4547 windows
4648 armv6l-linux
4749 musl