From 52aa6336a01666039056cddf3980c6f3255cc7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Tue, 29 Oct 2024 11:21:27 +0100 Subject: [PATCH] bump flake deps, use apple sdk 11.0 on x86_64-darwin --- flake.lock | 6 +++--- flake.nix | 54 ++++++++++++++++-------------------------------------- 2 files changed, 19 insertions(+), 41 deletions(-) diff --git a/flake.lock b/flake.lock index 5a4e6411..e26fa58d 100644 --- a/flake.lock +++ b/flake.lock @@ -79,11 +79,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1725001927, - "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=", + "lastModified": 1729973466, + "narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6e99f2a27d600612004fbd2c3282d614bfee6421", + "rev": "cd3e8833d70618c4eea8df06f95b364b016d4950", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6f4e3e91..176f120a 100644 --- a/flake.nix +++ b/flake.nix @@ -72,46 +72,24 @@ }; }; - x86_64-darwin = { - x86_64-darwin = { - rustTarget = "x86_64-apple-darwin"; - mkPackage = { pkgs, ... }: package: - let inherit (pkgs.darwin.apple_sdk.frameworks) AppKit Cocoa Security; - in package // { - buildInputs = [ AppKit Cocoa Security ]; - NIX_LDFLAGS = "-F${AppKit}/Library/Frameworks -framework AppKit -F${Security}/Library/Frameworks -framework Security"; - }; - }; - - # FIXME: https://github.com/NixOS/nixpkgs/issues/273442 - aarch64-darwin = { - rustTarget = "aarch64-apple-darwin"; - runner = { pkgs, himalaya }: "${pkgs.qemu}/bin/qemu-aarch64 ${himalaya}"; - mkPackage = { system, pkgs }: package: - let - inherit ((mkPkgsCross system "aarch64-darwin").pkgsStatic) stdenv darwin; - inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; - cc = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"; - in - package // { - buildInputs = [ Cocoa ]; - NIX_LDFLAGS = "-F${AppKit}/Library/Frameworks -framework AppKit"; - TARGET_CC = cc; - CARGO_BUILD_RUSTFLAGS = package.CARGO_BUILD_RUSTFLAGS ++ [ "-Clinker=${cc}" ]; - }; - }; + x86_64-darwin.x86_64-darwin = { + rustTarget = "x86_64-apple-darwin"; + mkPackage = { pkgs, ... }: package: + let inherit (pkgs.darwin.apple_sdk_11_0.frameworks) AppKit Cocoa; + in package // { + buildInputs = [ Cocoa ]; + NIX_LDFLAGS = "-F${AppKit}/Library/Frameworks -framework AppKit"; + }; }; - aarch64-darwin = { - aarch64-darwin = { - rustTarget = "aarch64-apple-darwin"; - mkPackage = { pkgs, ... }: package: - let inherit (pkgs.darwin.apple_sdk.frameworks) AppKit Cocoa; - in package // { - buildInputs = [ Cocoa ]; - NIX_LDFLAGS = "-F${AppKit}/Library/Frameworks -framework AppKit"; - }; - }; + aarch64-darwin.aarch64-darwin = { + rustTarget = "aarch64-apple-darwin"; + mkPackage = { pkgs, ... }: package: + let inherit (pkgs.darwin.apple_sdk.frameworks) AppKit Cocoa; + in package // { + buildInputs = [ Cocoa ]; + NIX_LDFLAGS = "-F${AppKit}/Library/Frameworks -framework AppKit"; + }; }; };