Skip to content

Commit

Permalink
Add apple sdk libraries for NIF compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
akash-akya committed Jul 26, 2024
1 parent baf89fb commit 4dea947
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 14 deletions.
34 changes: 34 additions & 0 deletions flake.lock

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

37 changes: 23 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,31 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, ... }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (nixpkgs.lib) optional;
pkgs = import nixpkgs { inherit system; };

sdk = with pkgs;
lib.optionals stdenv.isDarwin
(with darwin.apple_sdk.frameworks; [
# needed for compilation
pkgs.libiconv
AppKit
Foundation
CoreFoundation
CoreServices
]);

in {
devShell = pkgs.mkShell {
buildInputs =
[ pkgs.elixir sdk ];
};
});
in
{
devShells = forAllSystems ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
elixir
];
};
});
};

}

0 comments on commit 4dea947

Please sign in to comment.