diff --git a/default.nix b/default.nix index 970daa5..9fc5555 100644 --- a/default.nix +++ b/default.nix @@ -1,20 +1,13 @@ { pkgs ? import ./nix { overlays = [ (import ./nix/overlay.nix) ]; } }: let - ofborgOverrides = { - crateOverrides = pkgs.defaultCrateOverrides // { - ofborg = attrs: { - buildInputs = pkgs.lib.optional pkgs.stdenv.isDarwin - pkgs.darwin.apple_sdk.frameworks.Security; - }; - }; + ofborgCrates = pkgs.callPackage ./Cargo.nix { + cratesIO = pkgs.callPackage ./crates-io.nix {}; }; - drv = ((pkgs.callPackage ./Cargo.nix { - cratesIO = pkgs.callPackage ./crates-io.nix {}; - }).ofborg {}).override { release = false; }; + drv = ofborgCrates.ofborg {}; - src = stripDeps (drv.override ofborgOverrides); + src = stripDeps (drv.override { release = false; }); stripDeps = pkg: pkgs.runCommand "${pkg.name}-deps-stripped" {} '' @@ -27,6 +20,8 @@ let in { + ofborg.simple-build = ofborgCrates.ofborg_simple_build {}; + ofborg.rs = pkgs.runCommand "ofborg-rs-symlink-compat" { inherit src; } '' mkdir -p $out/bin for f in $(find $src -type f); do diff --git a/nix/overlay.nix b/nix/overlay.nix index 7e1b7a5..d874abd 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,5 +1,14 @@ -(self: super: { +(self: super: +{ defaultCrateOverrides = super.defaultCrateOverrides // { + ofborg = attrs: { + buildInputs = with self.darwin.apple_sdk.frameworks; + super.lib.optional super.stdenv.isDarwin Security; + }; + ofborg-simple-build = attrs: { + buildInputs = with self.darwin.apple_sdk.frameworks; + super.lib.optional super.stdenv.isDarwin Security; + }; openssl-sys = attrs: { buildInputs = [ self.openssl_1_0_2 ]; nativeBuildInputs = [ self.pkgconfig ];