Skip to content

Commit

Permalink
Use newer syntax to update apple sdk in nix (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
tateexon authored Apr 9, 2024
1 parent e62deff commit 1d1710b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 1 addition & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
8 changes: 6 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = ''
Expand Down

0 comments on commit 1d1710b

Please sign in to comment.