Error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory

Hello guys!

I’m currently getting the following error message if I’m trying to run our (my friend’s and my) rust project:

target/debug/flakeshot: error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory

Here is our flake.nix:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    rust-overlay.url = "github:oxalica/rust-overlay";
  };

  outputs = { nixpkgs, rust-overlay, ... }:
  let
    system = "x86_64-linux";
    pkgs = import nixpkgs {
      inherit system;

      overlays = [ rust-overlay.overlays.default ];
    };
    toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
  in
  {
    devShells.${system}.default = pkgs.mkShell {
      packages = with pkgs; [
        gtk3
      ] ++ [ toolchain ];

      buildInputs = with pkgs; [
        gtk3
      ];

      LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${builtins.toString (pkgs.lib.makeLibraryPath buildInputs)} ";
    };
  };
}

Now after nix develop and executing cargo run I’m getting the error message as stated above.
What are we doing wrong?

Ok, so I found the problem:
I needed to add patchelf to packages.