How to install these packages on nix

Hello,
I made a c++ repl with CMAKE to compile a c++ program with glfw to a .exe program. All works fine when I don’t add the glfw library (used to open a window), but when I add it, replit doesn’t add a vital package named X11. More specifically, I need these libraries :
apt-get install libxss-dev libxxf86vm-dev libxkbfile-dev libxv-dev
But I don’t know how to install them on my repl.
Could anyone help me?
Thank you
Repl link:

https://replit.com/@cldprv/CMAKE#main.cpp

1 Like

Hello,
to add these shared libraries, open replit.nix.
There is a deps variable, but shared libraries go in another spot. Try something like this:

{ pkgs }: {
  deps = [
    # stuff
  ];
  env = {
    LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
      pkgs.libxss-dev
    ];
  };
}
5 Likes

Hi!
To add the packages go to https://search.nixos.org/packages then search the packages that you need. To install you need to click on the package you’d like, then you will see Nix packages, click “NixOS Configuration” and copy the pkgs. and everything after on that line. Paste that in the replit.nix file.

There is an updated way to install nix packages, AKA system dependencies, in replit.
Open the System dependencies tool which manages your nix packages. There, you can view and install packages including shared library packages, so you don’t have to edit replit.nix.
(Note that on some repls, there is no install functionality in System dependencies.)

2 Likes