rPackages.textshaping not working on osx M1

Running nix-shell -p rPackages.textshaping --pure

generates the following error:

Error: package or namespace load failed for ‘textshaping’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/nix/store/vld4cxcxpr45ka3828x3qhx0vm3bj3gs-r-textshaping-0.3.6/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so':
  dlopen(/nix/store/vld4cxcxpr45ka3828x3qhx0vm3bj3gs-r-textshaping-0.3.6/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so, 0x0006): symbol not found in flat namespace '_fribidi_log2vis'

which seems like an issue with the fribidi dependency which perhaps it not compiled using the same compiler? I also notice the following earlier message:

Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'glib-2.0', required by 'harfbuzz', not found

however requiring glib does expose glib-2.0, I am however not sure how to check that it is available in the actual derivation.

textshaping is required to install devtools which iteself is quite a common package to include. This makes it a bit difficult to use R with nix on M1 at the moment.

Just to keep this going, I was able to build textshaping on M1 using the following nix file:

{
  pkgs ? import (fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/archive/4fe8d07066f6ea82cda2b0c9ae7aee59b2d241b3.tar.gz";
    sha256 = "sha256:06jzngg5jm1f81sc4xfskvvgjy5bblz51xpl788mnps1wrkykfhp";
  }) {}
}:

pkgs.rPackages.buildRPackage {
  name = "textshaping";
  version = "0.1.0";

  src = pkgs.fetchFromGitHub {                                      
    owner = "r-lib";                                                            
    repo = "textshaping";                         
    "rev"= "8619e5e6016ef7cceb4ed10099bc8b2624c24fa4";
    "sha256"= "6Ci2eok4DVxWd1nVxCMrUxKFAq/ZfHECOhY3bvKf9QM=";
    fetchSubmodules = false;                                                     
  };

  propagatedBuildInputs = [
    pkgs.R
    pkgs.rPackages.knitr
    pkgs.rPackages.rmarkdown
    pkgs.pkg-config
    pkgs.glib
    pkgs.fribidi
    pkgs.harfbuzz.dev
    pkgs.libpng
    pkgs.freetype
    pkgs.pcre
    pkgs.rPackages.cpp11
    pkgs.rPackages.systemfonts
    pkgs.darwin.apple_sdk.frameworks.CoreFoundation
    pkgs.darwin.apple_sdk.frameworks.Foundation
    pkgs.darwin.apple_sdk.frameworks.AppKit
    pkgs.pandoc
  ];
}

I am now trying to figure out how to incorporate that change in the nixpkgs. Any help is welcome!