diff --git a/flake.nix b/flake.nix index aa052e5..e80aef0 100644 --- a/flake.nix +++ b/flake.nix @@ -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 { diff --git a/overlay.nix b/overlay.nix index 9010386..5154028 100644 --- a/overlay.nix +++ b/overlay.nix @@ -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 { diff --git a/templates/app/flake.nix b/templates/app/flake.nix index 1238c4e..8d12bbc 100644 --- a/templates/app/flake.nix +++ b/templates/app/flake.nix @@ -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 ./. { - inherit (gomod2nix.legacyPackages.${system}) buildGoApplication; + 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 gomod2nix; }; })