1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config-rs,
6 openssl,
7 stdenv,
8 darwin,
9 python3,
10}:
11rustPlatform.buildRustPackage rec {
12 pname = "rcgen";
13 version = "0.14.3";
14
15 src = fetchFromGitHub {
16 owner = "rustls";
17 repo = "rcgen";
18 rev = "v${version}";
19 hash = "sha256-MtzOR7NIXZhGwmGdMvvI8zhKoqRTyiLaS+bIkD4wpeY=";
20 };
21
22 cargoHash = "sha256-hh328dPgbRJuy/YDZ/TBI807qmJ6qdiwnUn0Ols0BFo=";
23
24 nativeBuildInputs = [
25 pkg-config-rs
26 rustPlatform.bindgenHook
27 python3
28 ];
29
30 buildInputs =
31 [
32 openssl
33 ]
34 ++ lib.optionals stdenv.isDarwin [
35 darwin.apple_sdk.frameworks.Security
36 ];
37
38 meta = {
39 description = "Generate X.509 certificates, CSRs";
40 homepage = "https://github.com/rustls/rcgen";
41 license = lib.licenses.mit;
42 maintainers = with lib.maintainers; [noverby];
43 mainProgram = "rustls-cert-gen";
44 };
45}