Skip to content

Commit

Permalink
Add Security framework when building on darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarx committed Oct 18, 2023
1 parent 3d0b63b commit b63c1eb
Showing 1 changed file with 19 additions and 27 deletions.
46 changes: 19 additions & 27 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ rec {
cargo = toolchain;
rustc = toolchain;
};
defaultBuildInputs = [pkgs.openssl pkgs.openssl.dev];
defaultNativeBuildInputs = [
toolchain
pkgs.pkg-config
];
defaultBuildInputs = [pkgs.openssl pkgs.openssl.dev] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [pkgs.darwin.apple_sdk.frameworks.Security];
defaultNativeBuildInputs = [toolchain pkgs.pkg-config];
in rec {
packages = let
cargoMeta = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package;
Expand Down Expand Up @@ -274,34 +271,29 @@ rec {
export PATH=''${HOME}/.cargo/bin''${PATH+:''${PATH}}
'';

buildInputs = let
ifNotOn = systems:
pkgs.lib.optionals (!builtins.elem pkgs.system systems);
in
pkgs.lib.concatLists [
defaultBuildInputs
defaultNativeBuildInputs
[
pkgs.cargo-audit
pkgs.cargo-license
pkgs.cargo-tarpaulin
pkgs.gnuplot
pkgs.maturin
pkgs.python3
pkgs.wasm-pack
pkgs.wasm-bindgen-cli
pkgs.nodejs
]
# valgrind is linux-only
(ifNotOn ["aarch64-darwin" "x86_64-darwin"] [pkgs.valgrind])
];
buildInputs = pkgs.lib.concatLists [
defaultBuildInputs
defaultNativeBuildInputs
[
pkgs.cargo-audit
pkgs.cargo-license
pkgs.cargo-tarpaulin
pkgs.gnuplot
pkgs.maturin
pkgs.python3
pkgs.wasm-pack
pkgs.wasm-bindgen-cli
pkgs.nodejs
]
# valgrind is linux-only
(pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [pkgs.valgrind])
];
};

formatter = channels.nixpkgs.alejandra;
};
};
}

# Local Variables:
# apheleia-formatter: alejandra
# End:

0 comments on commit b63c1eb

Please sign in to comment.