diff --git a/flake.nix b/flake.nix index e11e8eac799..928b165ca35 100644 --- a/flake.nix +++ b/flake.nix @@ -10,9 +10,14 @@ 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 = pkgs.callPackage ./shell.nix { }; + devShell = callPackage ./shell.nix { + inherit pkgs; + }; formatter = pkgs.nixpkgs-fmt; }); } diff --git a/nix.conf b/nix.conf new file mode 100644 index 00000000000..c7d7291eb02 --- /dev/null +++ b/nix.conf @@ -0,0 +1 @@ +experimental-features = nix-command flakes diff --git a/shell.nix b/shell.nix index bc581f8e85a..7b64b7f58a1 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ -{ pkgs ? import { } }: +{ pkgs }: with pkgs; let go = go_1_21; @@ -46,6 +46,7 @@ mkShell { ]; LD_LIBRARY_PATH = "${stdenv.cc.cc.lib}/lib64:$LD_LIBRARY_PATH"; GOROOT = "${go}/share/go"; + CGO_ENABLED = 0; PGDATA = "db"; CL_DATABASE_URL = "postgresql://chainlink:chainlink@localhost:5432/chainlink_test?sslmode=disable";