Nix derivation failing on macos

Hi,

I have a Nix derivation here: git-ps-rs: init at 6.5.0 by Alizter · Pull Request #221183 · NixOS/nixpkgs · GitHub and it builds fine on Linux, however it seems to fail on darwin. I am unsure how I can debug this further.

I tried getting cross compilation for darwin, however I get the following:

nix-repl> legacyPackages.x86_64-linux.pkgsCross.x86_64-darwin.git-ps-rs
error: infinite recursion encountered

       at /nix/store/rlxmnwc3qm5nnqb3a47szhk6xjgggz0g-source/pkgs/stdenv/generic/make-derivation.nix:327:14:

          326|       args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)];
          327|       inherit stdenv;
             |              ^
          328|
«derivation 

Does anybody have any tips on how to debug darwin builds like this?

The solution in the end was to link with Security:

I had to change the deceleration in all-packages to:

  git-ps-rs = callPackage ../development/tools/git-ps-rs {
    inherit (darwin.apple_sdk.frameworks) Security;
  };

and add an optional build input:

  buildInputs = [ openssl dbus libgpg-error ]
    ++ lib.optionals stdenv.isDarwin [ Security ];

Thanks to mrene for the suggestion!

1 Like