2023-05-22 21:39:31 +00:00
|
|
|
{ mode }:
|
2023-05-22 00:32:09 +00:00
|
|
|
|
2024-11-11 14:21:34 +00:00
|
|
|
with import ./config.nix;
|
2023-05-22 00:32:09 +00:00
|
|
|
|
2023-05-22 21:39:31 +00: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 00:32:09 +00:00
|
|
|
|
2023-05-22 21:39:31 +00: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 00:32:09 +00:00
|
|
|
fi
|
|
|
|
|
2023-05-22 21:39:31 +00: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 00:32:09 +00:00
|
|
|
|