From ddce9496f25cd039e4fe8e86c9c69c987984f923 Mon Sep 17 00:00:00 2001
From: strawberry <strawberry@puppygock.gay>
Date: Sat, 11 May 2024 23:30:37 -0400
Subject: [PATCH] nix: fix building rust on macOS (Security apple_sdk
 framework)

Signed-off-by: strawberry <strawberry@puppygock.gay>
---
 nix/pkgs/main/default.nix | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/nix/pkgs/main/default.nix b/nix/pkgs/main/default.nix
index bdc97559d..30b93e58f 100644
--- a/nix/pkgs/main/default.nix
+++ b/nix/pkgs/main/default.nix
@@ -66,7 +66,11 @@ commonAttrs = {
       # right thing here.
       pkgsBuildHost.rustPlatform.bindgenHook
   ]
-  ++ lib.optionals stdenv.isDarwin [ libiconv ];
+      # https://github.com/NixOS/nixpkgs/issues/206242
+  ++ lib.optionals stdenv.isDarwin [ libiconv ]
+      # https://stackoverflow.com/questions/69869574/properly-adding-darwin-apple-sdk-to-a-nix-shell
+      # https://discourse.nixos.org/t/compile-a-rust-binary-on-macos-dbcrossbar/8612
+  ++ lib.optionals stdenv.isDarwin [ pkgsBuildHost.darwin.apple_sdk.frameworks.Security ];
  };
 in
 
-- 
GitLab