2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, openssl, runtimeShell }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2020-12-07 07:45:13 +00:00
|
|
|
version = "3.0.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
in stdenv.mkDerivation {
|
|
|
|
pname = "easyrsa";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenVPN";
|
|
|
|
repo = "easy-rsa";
|
|
|
|
rev = "v${version}";
|
2020-12-07 07:45:13 +00:00
|
|
|
sha256 = "05q60s343ydh9j6hzj0840qdcq8fkyz06q68yw4pqgqg4w68rbgs";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./fix-paths.patch ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/easyrsa
|
2020-12-07 07:45:13 +00:00
|
|
|
cp -r easyrsa3/{*.cnf,x509-types,vars.example} $out/share/easyrsa
|
|
|
|
cp easyrsa3/openssl-easyrsa.cnf $out/share/easyrsa/safessl-easyrsa.cnf
|
2020-04-24 23:36:52 +00:00
|
|
|
install -D -m755 easyrsa3/easyrsa $out/bin/easyrsa
|
|
|
|
substituteInPlace $out/bin/easyrsa \
|
|
|
|
--subst-var out \
|
|
|
|
--subst-var-by openssl ${openssl.bin}/bin/openssl
|
|
|
|
|
|
|
|
# Helper utility
|
|
|
|
cat > $out/bin/easyrsa-init <<EOF
|
|
|
|
#!${runtimeShell} -e
|
|
|
|
cp -r $out/share/easyrsa/* .
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/easyrsa-init
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Simple shell based CA utility";
|
|
|
|
homepage = "https://openvpn.net/";
|
|
|
|
license = licenses.gpl2;
|
2020-12-07 07:45:13 +00:00
|
|
|
maintainers = [ maintainers.offline maintainers.numinit ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|