0

I'm trying to build the "nvidiaBeta" driver, but it fails to build nvidia-settings with the error

gtk+-2.x/ctkgridlicense.c:38:23: fatal error: dbus/dbus.h: No such file or directory

I have tried installing all kinds of dbus packages but the closest thing I get in my nix store is a "dbus-c++/dbus.h" from the dbus_cplusplus derivation. While searching I've read that apparently what I need is supposed to be contained in "dbus-libs" but it doesn't seem to be available in channel 17.03.

I cannot seem to figure out which derivation is supposed to pull in this library. Can I somehow work around the issue and get it to use the one I have from the dbus_cplusplus derivation?

  • What commands are you executing to build the nvidiaBeta driver? – Emmanuel Rosa Aug 18 '17 at 16:29
  • I'm just defining services.xserver.videoDrivers = [ "nvidiaBeta" ]; in my configuration.nix and then building with nixos-rebuild switch. As for the dbus libraries I've been trying to install as well I am also just adding them to my configuration.nix file before building – ison Aug 18 '17 at 16:51
0

As already been mentioned Nix won't care about system or user installed packages when building a package, and the package in question needs to declare all of its dependencies explicitly.

Regarding this specific issue - the dbus/dbus.h file can be found in the dev output of the dbus derivation. Nix also provides facilities for overriding package definitions and we can use those to feed dbus.dev into build inputs of nvidia settings. Adding the following to configuration.nix:

nixpkgs.config.packageOverrides = pkgs:
{
  linuxPackages = pkgs.linuxPackages.extend(self: super: {
    nvidia_x11_beta = super.nvidia_x11_beta // {
      settings = super.nvidia_x11_beta.settings.overrideAttrs(old: {
        buildInputs = old.buildInputs ++ [ pkgs.dbus.dev ];
      });
    };
  });
};

allows the build to succeed on my 17.03 system.

  • This did the trick, thanks. I'm still learning and know a little about how to override packages to get dependencies. But I was completely hitting a wall without even knowing where the dbus.h file it needed was supposed to come from – ison Aug 22 '17 at 1:10
0

Unlike other distros, on NixOS even if you happen to install the right libraries it won't make a difference because packages must declare their dependencies for a build to succeed.

For example, if you try to build package A and it depends on package B, installing package B won't provide the dependency; package A simply won't see it.

As for Nvidia, I do not see nvidiaBeta as an option. You can use "nv" which is the open-source driver, or "nvidia" which is the proprietary driver. See https://nixos.org/nixos/manual/#idm140737316337280

  • I heard it mentioned in the IRC a while back and I also see it in here: github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/… But also it wouldn't even begin compiling if it wasn't defined somewhere. When I build it I actually see it pull in nvidia beta drivers and it fails during compiling nvidia-settings. – ison Aug 21 '17 at 0:28
  • I see. Well, then your best course of action is to create a bug report on the nix packages collection Git repo on GitHub. – Emmanuel Rosa Aug 21 '17 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.