Building from sources on MacOS with Nix

Godot Version

master branch (but more realistically any 4.3+ versions)

Question

I’m using Nix on NixOS (Linux) to build godot and my project (as well as packaging it).
I use Nix as my CI and I’m now trying to port everything to MacOS.

I see that I need several import to build godot (I think that’s some objective-C code, but I’m not an expert )

#import <AppKit/AppKit.h>
#import <AppKit/NSCursor.h>
#import <ApplicationServices/ApplicationServices.h>
#import <CoreVideo/CoreVideo.h>
#import <Foundation/Foundation.h>
#import <IOKit/pwr_mgt/IOPMLib.h>

where those headers come from ? I have Command Line Tools for Xcode but compilation fails at

platform/macos/gl_manager_macos_angle.h:42:10: fatal error: 'AppKit/AppKit.h' file not found
       > #include <AppKit/AppKit.h>

I’m a bit lost at how any of this is supposed to work, as I’m entirely new to the platform. Thank you in advance for your help.

so it seems that the issue is that I need to help the environment find AppKit and other frameworks.

something similar is done in nixpkgs for qtbase :

            substituteInPlace ./mkspecs/common/mac.conf \
                --replace "/System/Library/Frameworks/OpenGL.framework/" "${OpenGL}/Library/Frameworks/OpenGL.framework/" \
                --replace "/System/Library/Frameworks/AGL.framework/" "${AGL}/Library/Frameworks/AGL.framework/"