I had some issue trying to run a program. It gave hGetContents: invalid argument error. After googling around I came acroos
the following thread.
Looking at the thread it seems the issue is related to the value of LOCALE_CACHE environment variable. The thread links to a manual page that provides the solution for nixpkgs on Non-NixOS platform. NixOS wiki has a page on the topic which agains only shows the solution for Non-NixOS platforms.
Looking around the options in nixos, I came across i18n.glibcLocales and tried setting i18n.glibcLocales = pkgs.glibcLocales. Unfortunately it didn’t solve the issue.
The problem was due to me trying to directly run the binary provided by the repo.
Recompiling the library locally using cabal2nix fixes the issue without the need of setting any variables.