Skip to content

Commit

Permalink
update the reason why we have to use a newer sdk for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Sep 13, 2023
1 parent c169a11 commit 0ec0d58
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
let
pkgs = nixpkgs.legacyPackages.${system};

# The newer Darwin SDK does not exist in current (nixos-22.05) stable
# branches, so just fallback to the default callPackage.
# 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;

inherit (callPackage ./builder {
Expand Down
4 changes: 2 additions & 2 deletions overlay.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
final: prev:
let
# The newer Darwin SDK does not exist in current (nixos-22.05) stable
# branches, so just fallback to the default callPackage.
# 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 = final.darwin.apple_sdk_11_0.callPackage or final.callPackage;
in
{
Expand Down
8 changes: 6 additions & 2 deletions templates/app/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
(system:
let
pkgs = nixpkgs.legacyPackages.${system};

# 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
{
packages.default = pkgs.callPackage ./. {
packages.default = callPackage ./. {
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
};
devShells.default = pkgs.callPackage ./shell.nix {
devShells.default = callPackage ./shell.nix {
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication mkGoEnv;
};
})
Expand Down

0 comments on commit 0ec0d58

Please sign in to comment.