Stack config.yaml (or integration into NIX) seems to have problems with ‘-’ chars, so package name xdg-utils needs to be renamed xdg_utils. Is this the indented behavior? Where to find the proper package name in advance? Is this a pattern one should know?
This is indeed intended behavior as the proper name to refer to the package is xdg_utils.
The package has attribute path xdg_utils, which identifies this package within Nixpkgs. The name xdg-utils-1.1.3 is merely a used in the file names as a suggestion. Many different packages can share the same name, finding a package with a certain name, and most tools do not care about it. (There’s some legacy behavior in nix-env, which I’ll not get into.)
If you use nix search xdg-utils you will see it that it is to be referred to as nixpkgs.xdg_utils as well. Stack will add nixpkgs. (basically) for you so you will only have to write xdg_utils.
Great, Thanks a lot, for the precise and quick answer. Now I know where to get the name from.
That this fixed as well stack error not be able to start browser, missing xdg-open. Now I know I need to add xdg_utils to packages. Could not find this in any documentation.
It’s kind of surprising that you’re missing xdg-open in your environment, as it is a standard utility for Linux desktop environments. You might want to consider reporting this to Stack if you think the error message is confusing.