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

43 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, openssl, runtimeShell }:
2016-01-05 10:55:33 -08:00
let
2020-08-22 18:19:39 -07:00
version = "3.0.8";
2019-08-13 14:52:01 -07:00
in stdenv.mkDerivation {
2019-08-13 14:52:01 -07:00
pname = "easyrsa";
inherit version;
2016-01-05 10:55:33 -08:00
src = fetchFromGitHub {
owner = "OpenVPN";
repo = "easy-rsa";
rev = "v${version}";
2020-08-22 18:19:39 -07:00
sha256 = "05q60s343ydh9j6hzj0840qdcq8fkyz06q68yw4pqgqg4w68rbgs";
2013-07-10 12:00:56 -07:00
};
2016-01-05 10:55:33 -08:00
patches = [ ./fix-paths.patch ];
installPhase = ''
mkdir -p $out/share/easyrsa
2020-08-22 18:19:39 -07: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 10:55:33 -08:00
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 10:55:33 -08:00
# Helper utility
cat > $out/bin/easyrsa-init <<EOF
#!${runtimeShell} -e
2016-01-05 10:55:33 -08:00
cp -r $out/share/easyrsa/* .
EOF
chmod +x $out/bin/easyrsa-init
2013-07-10 12:00:56 -07:00
'';
meta = with stdenv.lib; {
description = "Simple shell based CA utility";
homepage = "https://openvpn.net/";
2013-07-10 12:00:56 -07:00
license = licenses.gpl2;
2020-08-22 18:19:39 -07:00
maintainers = [ maintainers.offline maintainers.numinit ];
2018-10-13 20:10:21 -07:00
platforms = platforms.unix;
2013-07-10 12:00:56 -07:00
};
}