From c9dde4d9f4ad8eeaa117522563bdec0a4ff5a353 Mon Sep 17 00:00:00 2001 From: Drew Hess Date: Wed, 16 Dec 2020 16:00:20 +0000 Subject: [PATCH] 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 --- overlays/darwin.nix | 24 +++++++++++++++++++++--- overlays/default.nix | 2 ++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/overlays/darwin.nix b/overlays/darwin.nix index 805e73b74a..12a1582f37 100644 --- a/overlays/darwin.nix +++ b/overlays/darwin.nix @@ -1,3 +1,21 @@ -final: prev: { - -} \ No newline at end of file +final: prev: +{ + haskell-nix = prev.haskell-nix // ({ + defaultModules = prev.haskell-nix.defaultModules ++ [ + ({ pkgs, buildModules, config, lib, ... }: + { + packages = { } // pkgs.lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && !pkgs.stdenv.cc.nativeLibc) + { + # Workaround for broken nixpkgs darwin.security_tool in + # Mojave. This mirrors the workaround in nixpkgs + # haskellPackages. + # + # ref: + # https://github.com/NixOS/nixpkgs/pull/47676 + # https://github.com/NixOS/nixpkgs/issues/45042 + x509-system.components.library.preBuild = "substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security"; + }; + }) + ]; + }); +} diff --git a/overlays/default.nix b/overlays/default.nix index dab252053d..99ae4d3c5c 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -10,6 +10,7 @@ let bootstrap = import ./bootstrap.nix; ghc = import ./ghc.nix; ghc-packages = import ./ghc-packages.nix; + darwin = import ./darwin.nix; windows = import ./windows.nix; armv6l-linux = import ./armv6l-linux.nix; musl = import ./musl.nix; @@ -42,6 +43,7 @@ let bootstrap ghc ghc-packages + darwin windows armv6l-linux musl