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