Find what package provides a specific library

Wanna play a steam game on nixos but unsure on how to search what package provides what library. Library in question is On a normal distro it would just be dnf provides /usr/lib/ but what is the nixos equivalent?

There’s a package you can install called nix-index that will index all of the binaries available in the binary cache and use that to let you search for files.

There’s also a bot on the #nixos IRC channel, which says that file is provided by gperftools


added this to my system packages but gpuperftools is providing a 64bit library when the game needs a 32bit one

(steam.override { extraPkgs = pkgs: [ gperftools ]; }).run

Many thanks for the help

Can you cross-compile it?

1 Like

I could. What would i need todo that?

I’ve never done it but I would start by reading the relevant manual section.

1 Like

I don’t know how to produce just a plain 32bit cross compilation, but maybe pkgs.pkgsCross.musl32.gperftools is what you are looking for? That at least seem to evaluate:

nix build nixpkgs.pkgsCross.musl32.gperftools
1 Like