buildDotnetModule runtimeDeps from nugetDeps

I’m trying to pack MSBuildStructuredLog tool using buildDotnetModule. Some of its native dependencies (namely are coming from nuget packages and they are placed alongside executable. Is there a way to pass these libraries to buildDotnetModule.runtimeDeps so they can be linked properly?

My derivation:

{ lib
, buildDotnetModule
, dotnetCorePackages
, fetchFromGitHub
, zlib
, openssl
, libX11
, libICE
, libSM

buildDotnetModule rec {
  pname = "MSBuildStructuredLog";
  version = "2.1.745";

  src = fetchFromGitHub {
    owner = "KirillOsenkov";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-4iMTFqpXmZaB+RR0c4ObY36rwjfJEdQlsqmNRA+4S+o=";

  selfContainedBuild = true;

  projectFile = "src/StructuredLogViewer.Avalonia/StructuredLogViewer.Avalonia.csproj";
  nugetDeps = ./deps.nix;

  runtimeDeps = [
    #this doesn't work -> "$out/bin/"

  dotnetFlags = [
    "--runtime linux-x64"

  dotnetbuildFlags = [
    "-c Release"

  dotnetPackFlags = [
    "--runtime linux-x64"

  meta = with lib; {
    homepage = "";
    description = "MSBuild log viewer";
    license =;
    maintainers = with maintainers; [ anpin ];
    platforms = [ "x86_64-linux" ];

The error I’m currently getting on startup

Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory
   at SkiaSharp.SkiaApi.sk_colortype_get_default_8888()
   at SkiaSharp.SKImageInfo..cctor()
   --- End of inner exception stack trace ---
   at Avalonia.Skia.PlatformRenderInterface..ctor(ISkiaGpu skiaGpu, Nullable`1 maxResourceBytes) in /_/src/Skia/Avalonia.Skia/PlatformRenderInterface.cs:line 27
   at Avalonia.Skia.SkiaPlatform.Initialize(SkiaOptions options) in /_/src/Skia/Avalonia.Skia/SkiaPlatform.cs:line 20
   at Avalonia.SkiaApplicationExtensions.<>c__0`1.<UseSkia>b__0_0() in /_/src/Skia/Avalonia.Skia/SkiaApplicationExtensions.cs:line 20
   at Avalonia.Controls.AppBuilderBase`1.Setup() in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 304
   at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime) in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 179
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 208
   at StructuredLogViewer.Avalonia.Program.Main(String[] args) in /build/source/src/StructuredLogViewer.Avalonia/Program.cs:line 9
[1]    609185 IOT instruction (core dumped)  StructuredLogViewer.Avalonia

Build result bin folder

ls /nix/store/6ihpm58rvp7ry9bp3glqsivrnhm3czvv-MSBuildStructuredLog-2.1.745/bin
createdump                                                      StructuredLogViewer.Avalonia

The phrase “or one of its dependencies” is doing the heavy lifting here:

Add fontconfig to runtimeDeps.

thank you @raphi I didn’t thought this through!