Skip to content

Commit b8398ad

Browse files
authored
Merge pull request #303 from matter-labs/ld_library_path
refactor(shells): simplify environment variable declarations
2 parents 2d9a7bd + 8903c1d commit b8398ad

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

shells/teepot/default.nix

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,23 @@ mkShell {
4242
google-cloud-sdk
4343
];
4444

45-
TEE_LD_LIBRARY_PATH = lib.makeLibraryPath (
46-
lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
47-
pkgs.curl
48-
nixsgx.sgx-dcap
49-
nixsgx.sgx-dcap.quote_verify
50-
nixsgx.sgx-dcap.default_qpl
51-
]
52-
);
53-
54-
QCNL_CONF_PATH =
55-
if (stdenv.hostPlatform.system != "x86_64-linux") then
56-
""
57-
else
58-
"${nixsgx.sgx-dcap.default_qpl}/etc/sgx_default_qcnl.conf";
59-
OPENSSL_NO_VENDOR = "1";
60-
RUST_SRC_PATH = "${toolchain_with_src}/lib/rustlib/src/rust/library";
45+
env = {
46+
QCNL_CONF_PATH =
47+
if (stdenv.hostPlatform.system != "x86_64-linux") then
48+
""
49+
else
50+
"${nixsgx.sgx-dcap.default_qpl}/etc/sgx_default_qcnl.conf";
51+
OPENSSL_NO_VENDOR = "1";
52+
RUST_SRC_PATH = "${toolchain_with_src}/lib/rustlib/src/rust/";
53+
};
6154

6255
shellHook = ''
63-
if [ "x$NIX_LD" = "x" ]; then
64-
export NIX_LD=$(<${stdenv.cc}/nix-support/dynamic-linker)
65-
fi
66-
if [ "x$NIX_LD_LIBRARY_PATH" = "x" ]; then
67-
export NIX_LD_LIBRARY_PATH="$TEE_LD_LIBRARY_PATH"
68-
else
69-
export NIX_LD_LIBRARY_PATH="$NIX_LD_LIBRARY_PATH:$TEE_LD_LIBRARY_PATH"
70-
fi
56+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${
57+
pkgs.lib.makeLibraryPath (lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
58+
pkgs.curl
59+
nixsgx.sgx-dcap
60+
nixsgx.sgx-dcap.quote_verify
61+
nixsgx.sgx-dcap.default_qpl
62+
])}"
7163
'';
7264
}

0 commit comments

Comments
 (0)