3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/security/step-ca/default.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, fetchFromGitHub
, buildGoModule
, coreutils
, pcsclite
, PCSC
, pkg-config
, hsmSupport ? true
}:
2019-12-12 04:38:15 +00:00
buildGoModule rec {
2019-12-12 04:38:15 +00:00
pname = "step-ca";
2021-10-02 16:43:22 +01:00
version = "0.17.4";
2019-12-12 04:38:15 +00:00
src = fetchFromGitHub {
owner = "smallstep";
repo = "certificates";
rev = "v${version}";
2021-10-02 16:43:22 +01:00
sha256 = "sha256-X4dOrd/wxtYLw3C4Lj88RV/J6CEkmsOeqtiVX/6VFHg=";
2019-12-12 04:38:15 +00:00
};
2021-10-02 16:43:22 +01:00
vendorSha256 = "sha256-/8Glo+U8MS8Y8mKECgTAB7JWmp/rjMQhG4nZkNs+Zgs=";
2021-08-26 07:45:51 +01:00
ldflags = [ "-buildid=" ];
2021-07-28 15:39:09 +01:00
nativeBuildInputs = lib.optionals hsmSupport [ pkg-config ];
buildInputs =
lib.optionals (hsmSupport && stdenv.isLinux) [ pcsclite ]
++ lib.optionals (hsmSupport && stdenv.isDarwin) [ PCSC ];
postPatch = ''
substituteInPlace systemd/step-ca.service --replace "/bin/kill" "${coreutils}/bin/kill"
'';
preBuild = ''
${lib.optionalString (!hsmSupport) "export CGO_ENABLED=0"}
'';
postInstall = ''
install -Dm444 -t $out/lib/systemd/system systemd/step-ca.service
'';
# Tests start http servers which need to bind to local addresses:
# panic: httptest: failed to listen on a port: listen tcp6 [::1]:0: bind: operation not permitted
__darwinAllowLocalNetworking = true;
2019-12-12 04:38:15 +00:00
meta = with lib; {
description = "A private certificate authority (X.509 & SSH) & ACME server for secure automated certificate management, so you can use TLS everywhere & SSO for SSH";
homepage = "https://smallstep.com/certificates/";
license = licenses.asl20;
maintainers = with maintainers; [ cmcdragonkai mohe2015 ];
2019-12-12 04:38:15 +00:00
platforms = platforms.linux ++ platforms.darwin;
};
}