Issues Building gst-plugins-base When Overriding Mesa & Libdrm to Unstable on NixOS

Hi everyone,

I’m trying to override specific packages in my NixOS configuration to use the Mesa and Libdrm versions from the unstable channel. My goal is to use the unstable versions of Mesa and Libdrm while keeping the rest of my system on stable. However, I’m running into build issues, particularly with gst-plugins-base, which is failing to build.

Below is a simplified version of my current overlay in /etc/nixos/configuration.nix:

{ config, pkgs, ... }:
let 
  unstable = import (builtins.fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
    # Optionally fix a specific revision:
    # rev = "commit_hash";
  }) { };
in {
  imports = [ 
    ./hardware-configuration.nix 
  ];
  
  nixpkgs.overlays = [
    (self: super: {
      mesa             = unstable.mesa;
      libdrm           = unstable.libdrm;
      libva            = unstable.libva;
      libva-minimal    = unstable.libva-minimal;
      mesa-demos       = unstable.mesa-demos;
      ffmpeg-headless  = unstable.ffmpeg-headless.overrideAttrs (oldAttrs: rec {
        buildInputs = (oldAttrs.buildInputs or []) ++ [ unstable.libdrm ];
      });
      gst-plugins-base = unstable.gst-plugins-base.overrideAttrs (oldAttrs: {
        mesonFlags = (oldAttrs.mesonFlags or []) ++ [ "-Dintrospection=disabled" ];
      });
    })
  ];

  # ... the rest of my configuration ...

  system.stateVersion = "24.11";
}

When I run sudo nixos-rebuild switch, I get errors during the build of gst-plugins-base. For example, one of the errors is:

ERROR: libdrm requested but not found
...
ninja: build stopped: subcommand failed.
error: builder for '/nix/store/gn9ih4fa0lll3rvjcxsyj33v2h3fg44i-gst-plugins-base-1.24.10.drv' failed with exit code 1

I’ve also seen errors during the generation of GObject Introspection files (e.g., GstTag-1.0.gir). Although I attempted to disable introspection by adding the flag -Dintrospection=disabled to the meson flags, the build still fails.

I understand that mixing unstable packages (especially interdependent components like Mesa, Libdrm, and gst-plugins-base) with the stable system can lead to compatibility issues. I would appreciate any advice on the following:

  • Which additional packages might need to be overridden to maintain compatibility.
  • Known issues or patches for gst-plugins-base (or related packages) when using unstable Mesa and Libdrm.
    
  • Alternative approaches to using unstable Mesa and Libdrm without breaking the build of gst-plugins-base.
    

Thank you very much for your help and insights!

Best regards,