nixpkgs/modules/security/ca.nix
Bjørn Forsman 10133f0b5b Add /etc/ssl/certs/ca-certificates.crt symlink for Ubuntu compatibility
NixOS and Fedora uses .../ca-bundle.crt. Ubuntu uses
.../ca-certificates.crt. Add .../ca-certificates.crt symlink to be
compatible with Ubuntu.

Example use case: Bob has a ~/.msmtprc file that he brings over from
Ubuntu. It also works on NixOS.
2013-08-17 13:13:02 +02:00

38 lines
880 B
Nix

{ config, pkgs, ... }:
with pkgs.lib;
{
config = {
environment.etc =
[
# Provide both Fedora and Ubuntu certificate locations for
# compatibility.
{ source = "${pkgs.cacert}/etc/ca-bundle.crt";
target = "ssl/certs/ca-bundle.crt"; # Same location as in Fedora
}
{ source = "${pkgs.cacert}/etc/ca-bundle.crt";
target = "ssl/certs/ca-certificates.crt"; # Same location as in Ubuntu
}
# Backward compatibility; may remove at some point.
{ source = "${pkgs.cacert}/etc/ca-bundle.crt";
target = "ca-bundle.crt";
}
];
environment.shellInit =
''
export OPENSSL_X509_CERT_FILE=/etc/ssl/certs/ca-bundle.crt
export CURL_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crt
export GIT_SSL_CAINFO=/etc/ssl/certs/ca-bundle.crt
'';
};
}