manage certs on darwin via nix

This commit is contained in:
Cyryl Płotnicki 2022-10-05 14:04:38 +01:00
parent f444bbf342
commit bb9710df8a
2 changed files with 33 additions and 7 deletions

View file

@ -1,4 +1,11 @@
{ config, pkgs, inputs, lib, nixpkgs-nixos-unstable-and-unfree, ... }: { { config, pkgs, inputs, lib, nixpkgs-nixos-unstable-and-unfree, ... }:
let
system_cert_bundle_path = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
form3_cert_path = ./form3-palo-alto.pem;
form3_cert_bundle = builtins.toFile "form3-cert-bundle.crt"
(builtins.readFile system_cert_bundle_path
+ builtins.readFile form3_cert_path);
in {
environment.systemPackages = with pkgs; [ vim nixfmt ]; environment.systemPackages = with pkgs; [ vim nixfmt ];
imports = [ ../../git ../../mercurial ]; imports = [ ../../git ../../mercurial ];
@ -31,14 +38,13 @@
source-code-pro source-code-pro
weather-icons weather-icons
]; ];
security.pki.certificateFiles = [ security.pki.certificateFiles = [ form3_cert_path system_cert_bundle_path ];
"/Users/Shared/form3-certs/form3-palo-alto.pem"
"${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
environment.variables = { environment.variables = {
NIX_SSL_CERT_FILE = "/Users/cyryl/certs/bundle.crt"; NIX_SSL_CERT_FILE = form3_cert_bundle;
BUNDLE_SSL_CA_CERT = form3_cert_bundle;
CARGO_NET_GIT_FETCH_WITH_CLI = "true";
}; };
programs.zsh.enable = true; # default shell on catalina programs.zsh.enable = true;
system.stateVersion = 4; system.stateVersion = 4;

View file

@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDUjCCAjqgAwIBAgIJAKGbgmk1v5iwMA0GCSqGSIb3DQEBCwUAMFkxCzAJBgNV
BAYTAkdCMSMwIQYDVQQKExpCYWNrIE9mZmljZSBUZWNobm9sb2d5IEx0ZDElMCMG
A1UEAxMccGFsby1hbHRvLnN5c3RlbXMuZm9ybTMudGVjaDAeFw0yMTAyMjMwOTQ4
MjlaFw0yNDAyMjMwOTQ4Mj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