2019-02-26 11:45:54 +00:00
|
|
|
{ stdenv, fetchFromGitHub, openssl, runtimeShell }:
|
2016-01-05 18:55:33 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
version = "3.0.0";
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "easyrsa-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenVPN";
|
|
|
|
repo = "easy-rsa";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0wbdv3wmqwm5680rpb971l56xiw49adpicqshk3vhfmpvqzl4dbs";
|
2013-07-10 19:00:56 +00:00
|
|
|
};
|
|
|
|
|
2016-01-05 18:55:33 +00:00
|
|
|
patches = [ ./fix-paths.patch ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/easyrsa
|
|
|
|
cp -r easyrsa3/{openssl*.cnf,x509-types,vars.example} $out/share/easyrsa
|
|
|
|
install -D -m755 easyrsa3/easyrsa $out/bin/easyrsa
|
|
|
|
substituteInPlace $out/bin/easyrsa \
|
|
|
|
--subst-var out \
|
2016-02-01 18:46:16 +00:00
|
|
|
--subst-var-by openssl ${openssl.bin}/bin/openssl
|
2016-01-05 18:55:33 +00:00
|
|
|
|
|
|
|
# Helper utility
|
|
|
|
cat > $out/bin/easyrsa-init <<EOF
|
2019-02-26 11:45:54 +00:00
|
|
|
#!${runtimeShell} -e
|
2016-01-05 18:55:33 +00:00
|
|
|
cp -r $out/share/easyrsa/* .
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/easyrsa-init
|
2013-07-10 19:00:56 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Simple shell based CA utility";
|
2018-05-01 03:03:23 +00:00
|
|
|
homepage = https://openvpn.net/;
|
2013-07-10 19:00:56 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.offline ];
|
2018-10-14 03:10:21 +00:00
|
|
|
platforms = platforms.unix;
|
2013-07-10 19:00:56 +00:00
|
|
|
};
|
|
|
|
}
|