Hi nix community, loving the idea behind nix/nixos.
I’m trying out nixos and nix (in docker) to host a rust program. It’s asking me to set OPENSSL_DIR or OPENSSL_LIB_DIR, I installed:
nix-env -iA nixos.openssl
Thanks in advance,
This lead me to the answers:
The lib, includes are in a dir with ‘-dev’ appended in the /nix/store rather than in the standard dir.
TODO: Find nice way to pick up that dir.
openssl is a split package (with multiple outputs). Read more about it there especially “using a split package”
The dir your are looking for is actually the attribute openssl.dev in nix parlance.
Side comment: openssl still points to v1.0.2. If you are starting a fresh project you might want to use openssl_1_1_0 :
nix-env -iA nixos.openssl_1_1_0
Adding to the answer from Linus, you probably don’t want to use nix-env for this. Typical cases
nix-shell -p openssl
That’s really working well.