2021-11-09 15:09:14 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-12-13 14:33:22 +00:00
|
|
|
, fetchFromGitHub
|
2021-11-09 15:09:14 +00:00
|
|
|
, autoreconfHook
|
|
|
|
, makeWrapper
|
|
|
|
, gnugrep
|
|
|
|
, openssl
|
|
|
|
}:
|
2016-01-25 09:13:10 +00:00
|
|
|
|
2021-11-09 15:09:14 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "easyrsa";
|
|
|
|
version = "2.2.0";
|
2016-01-25 09:13:10 +00:00
|
|
|
|
2021-12-13 14:33:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenVPN";
|
|
|
|
repo = "easy-rsa";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-zTdk8mv+gC/SHK813wZ6CWZf9Jm2XkKfAPU3feFpAkY=";
|
2016-01-25 09:13:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
mkdir -p $out/share/easy-rsa
|
|
|
|
'';
|
|
|
|
|
2016-08-24 19:35:08 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
|
|
|
buildInputs = [ gnugrep openssl ];
|
2016-01-25 09:13:10 +00:00
|
|
|
|
|
|
|
# Make sane defaults and patch default config vars
|
|
|
|
postInstall = ''
|
|
|
|
cp $out/share/easy-rsa/openssl-1.0.0.cnf $out/share/easy-rsa/openssl.cnf
|
|
|
|
for prog in $(find "$out/share/easy-rsa" -executable -type f); do
|
|
|
|
makeWrapper "$prog" "$out/bin/$(basename $prog)" \
|
|
|
|
--set EASY_RSA "$out/share/easy-rsa" \
|
2016-04-10 19:51:13 +00:00
|
|
|
--set OPENSSL "${openssl.bin}/bin/openssl" \
|
2016-01-25 09:13:10 +00:00
|
|
|
--set GREP "${gnugrep}/bin/grep"
|
|
|
|
done
|
|
|
|
sed -i "/EASY_RSA=\|OPENSSL=\|GREP=/d" $out/share/easy-rsa/vars
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-01-25 09:13:10 +00:00
|
|
|
description = "Simple shell based CA utility";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://openvpn.net/";
|
2016-01-25 09:13:10 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.offline ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|