From 1d1710b3c310cfcee1f0f1d2221173e859639b8f Mon Sep 17 00:00:00 2001 From: Tate Date: Tue, 9 Apr 2024 12:04:26 -0600 Subject: [PATCH] Use newer syntax to update apple sdk in nix (#909) --- flake.nix | 5 +---- shell.nix | 8 ++++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index e86a1f225..995cd783a 100644 --- a/flake.nix +++ b/flake.nix @@ -10,11 +10,8 @@ flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; overlays = [ ]; }; - # The current default sdk for macOS fails to compile go projects, so we use a newer one for now. - # This has no effect on other platforms. - callPackage = pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage; in rec { - devShell = callPackage ./shell.nix { + devShell = pkgs.callPackage ./shell.nix { inherit pkgs; scriptDir = toString ./.; # This converts the flake's root directory to a string }; diff --git a/shell.nix b/shell.nix index 3f4f8bc65..4f892e45a 100644 --- a/shell.nix +++ b/shell.nix @@ -5,8 +5,13 @@ let postgresql = postgresql_15; nodejs = nodejs-18_x; nodePackages = pkgs.nodePackages.override { inherit nodejs; }; + + mkShell' = mkShell.override { + # The current nix default sdk for macOS fails to compile go projects, so we use a newer one for now. + stdenv = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv; + }; in -mkShell { +mkShell' { nativeBuildInputs = [ go goreleaser @@ -47,7 +52,6 @@ mkShell { LD_LIBRARY_PATH = lib.makeLibraryPath [pkgs.zlib stdenv.cc.cc.lib]; # lib64 GOROOT = "${go}/share/go"; - CGO_ENABLED = 0; HELM_REPOSITORY_CONFIG = "${scriptDir}/.helm-repositories.yaml"; shellHook = ''