Skip to content

Commit

Permalink
Get the Nix build working on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegley committed Sep 26, 2024
1 parent e0218da commit 69f7681
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
6 changes: 3 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ source-repository-package

source-repository-package
type: git
location: https://github.com/larskuhtz/lurk-hs.git
tag: 7e71572e478f9d4c2c60af7f39ca6218776937d5
--sha256: sha256-2ghQArnZ/KLSmuH/rhSb9smKeAfEmtgHFHO78aQ6evo=
location: https://github.com/jwiegley/lurk-hs.git
tag: 4ddaabc23082f32287534d32c442bb04083626a8
--sha256: sha256-Jv2G8CYBFQDvYD0O0U54a5ZUDzoqhdZLy0kwquOPmA4=

-- -------------------------------------------------------------------------- --
-- Relaxed Bounds
Expand Down
13 changes: 10 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,16 @@ let haskellSrc = with nix-filter.lib; filter {
zlib
pkg-config
sqlite
rustc
cargo
go
openssl
# The version of Rust desired can be fixed here by changing `latest`
# to a version string, like `"1.81.0"`.
rust-bin.stable."1.81.0".minimal
rustPlatform.bindgenHook
go_1_22
llvmPackages.libclang.dev
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.CoreServices
];
modules = [
{
Expand Down
4 changes: 2 additions & 2 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 20 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
flake = false;
};
hs-nix-infra = {
url = "github:kadena-io/hs-nix-infra";
# url = "github:kadena-io/hs-nix-infra";
url = "git+file:///home/johnw/argument/hs-nix-infra";
inputs.hackage.follows = "hackage";
};
flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
rust-overlay.url = "github:oxalica/rust-overlay";
empty = {
url = "github:kadena-io/empty";
flake = false;
Expand All @@ -25,7 +27,7 @@
trusted-public-keys = "nixcache.chainweb.com:FVN503ABX9F8x8K0ptnc99XEz5SaA4Sks6kNcZn2pBY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=";
};

outputs = inputs@{ self, hs-nix-infra, flake-utils, nix-filter, ... }:
outputs = inputs@{ self, hs-nix-infra, rust-overlay, flake-utils, nix-filter, ... }:
flake-utils.lib.eachSystem
[ "x86_64-linux" "x86_64-darwin"
"aarch64-linux" "aarch64-darwin" ] (system:
Expand All @@ -37,7 +39,22 @@
pkgs = import nixpkgs {
inherit system;
inherit (haskellNix) config;
overlays = [ haskellNix.overlay ];
overlays = [
haskellNix.overlay
(import rust-overlay)
(final: prev: {
mkShell = args:
with prev; mkShell.override {
stdenv =
if stdenv.isDarwin
then overrideSDK stdenv "11.0"
else stdenv;
} (args // {
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion pkgs.clang}/include";
});
})
];
};
mkDefaultNix = {
pact ? pactInput,
Expand Down

0 comments on commit 69f7681

Please sign in to comment.