Hacker symbol

February 27, 2020 ~ 1 min read

Environment vars in nix shell


Example of how to setup environment variables for a split package:

with import <nixpkgs> { };

stdenv.mkDerivation {
  name = "eands";

  buildInputs = [
    rustup
    openssl_1_0_2
  ];
  OPENSSL_INCLUDE_DIR="${openssl_1_0_2.dev}/include/openssl";
  OPENSSL_LIB_DIR="${openssl_1_0_2.out}/lib";
  OPENSSL_ROOT_DIR="${openssl_1_0_2.out}";
}

Sebastian BolaƱos

Hi, I'm Sebastian. I'm a software developer from Costa Rica. You can follow me on Twitter. I enjoy working on distributed systems.