nixpkgs-suyu/pkgs/tools/networking/easyrsa/default.nix

42 lines
1 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, openssl, runtimeShell }:
2016-01-05 19:55:33 +01:00
let
version = "3.0.0";
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}";
sha256 = "0wbdv3wmqwm5680rpb971l56xiw49adpicqshk3vhfmpvqzl4dbs";
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
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 \
--subst-var-by openssl ${openssl.bin}/bin/openssl
2016-01-05 19:55:33 +01:00
# Helper utility
cat > $out/bin/easyrsa-init <<EOF
#!${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
'';
meta = with stdenv.lib; {
description = "Simple shell based CA utility";
homepage = "https://openvpn.net/";
2013-07-10 21:00:56 +02:00
license = licenses.gpl2;
maintainers = [ maintainers.offline ];
2018-10-14 05:10:21 +02:00
platforms = platforms.unix;
2013-07-10 21:00:56 +02:00
};
}