2023-05-23 00:39:31 +03:00
|
|
|
{ mode }:
|
2023-05-22 03:32:09 +03:00
|
|
|
|
2024-11-07 14:46:37 +02:00
|
|
|
with import "${builtins.getEnv "_NIX_TEST_BUILD_DIR"}/config.nix";
|
2023-05-22 03:32:09 +03:00
|
|
|
|
2023-05-23 00:39:31 +03:00
|
|
|
mkDerivation (
|
|
|
|
{
|
|
|
|
name = "ssl-export";
|
|
|
|
buildCommand = ''
|
|
|
|
# Add some indirection, otherwise grepping into the debug output finds the string.
|
|
|
|
report () { echo CERT_$1_IN_SANDBOX; }
|
2023-05-22 03:32:09 +03:00
|
|
|
|
2023-05-23 00:39:31 +03:00
|
|
|
if [ -f /etc/ssl/certs/ca-certificates.crt ]; then
|
|
|
|
content=$(</etc/ssl/certs/ca-certificates.crt)
|
|
|
|
if [ "$content" == CERT_CONTENT ]; then
|
|
|
|
report present
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
report missing
|
2023-05-22 03:32:09 +03:00
|
|
|
fi
|
|
|
|
|
2023-05-23 00:39:31 +03:00
|
|
|
# Always fail, because we do not want to bother with fixed-output
|
|
|
|
# derivations being cached, and do not want to compute the right hash.
|
|
|
|
false;
|
|
|
|
'';
|
|
|
|
} // {
|
|
|
|
fixed-output = { outputHash = "sha256:0000000000000000000000000000000000000000000000000000000000000000"; };
|
|
|
|
normal = { };
|
|
|
|
}.${mode}
|
|
|
|
)
|
2023-05-22 03:32:09 +03:00
|
|
|
|