Skip to content

Commit

Permalink
Merge pull request #805 from yacinehmito/disable-pki
Browse files Browse the repository at this point in the history
Add security.pki.installCACerts config
  • Loading branch information
Enzime authored Nov 11, 2023
2 parents c8f3857 + 4fa7b5c commit 0f1ad80
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion modules/security/pki/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ in

{
options = {
security.pki.installCACerts = mkOption {
type = types.bool;
default = true;
description = lib.mdDoc ''
Whether to enable certificate management with nix-darwin.
'';
};

security.pki.certificateFiles = mkOption {
type = types.listOf types.path;
default = [];
Expand Down Expand Up @@ -71,7 +79,7 @@ in
};
};

config = {
config = mkIf cfg.installCACerts {

security.pki.certificateFiles = [ "${cacertPackage}/etc/ssl/certs/ca-bundle.crt" ];

Expand Down
5 changes: 4 additions & 1 deletion modules/services/nix-daemon.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ in

serviceConfig.EnvironmentVariables = mkMerge [
config.nix.envVars
{ NIX_SSL_CERT_FILE = mkDefault config.environment.variables.NIX_SSL_CERT_FILE;
{
NIX_SSL_CERT_FILE = mkIf
(config.environment.variables ? NIX_SSL_CERT_FILE)
(mkDefault config.environment.variables.NIX_SSL_CERT_FILE);
TMPDIR = mkIf (cfg.tempDir != null) cfg.tempDir;
# FIXME: workaround for https://github.com/NixOS/nix/issues/2523
OBJC_DISABLE_INITIALIZE_FORK_SAFETY = mkDefault "YES";
Expand Down

0 comments on commit 0f1ad80

Please sign in to comment.