Installing libraries globally through nix profiles (e.g. nix-env
or environment.systemPackages
NixOS option) is not suported, see I installed a library but my compiler is not finding it. Why?
If those are build/installation time-only depencencies, you could run the installation script in nix-shell
but it will not work reliably if the dependencies are needed at runtime. Nix will not be aware of the dependency and the garbage collector might clear the packages out.
Either way proper way to install stuff on NixOS is creating a Nix package and installing that. For packaging GTK themes, see How to set up a GTK3 theme, thats not in the nix pkgs?. But WhiteSur is actually already packaged in Nixpkgs as whitesur-gtk-theme
so you can skip the packaging step.