summary refs log tree commit diff
path: root/pkgs/tools/networking/openvpn
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2016-09-15 20:22:25 -0700
committerJohn Ericson <Ericson2314@Yahoo.com>2016-09-16 07:24:03 -0700
commitea1caf92725f72c8cb1a0f68c54fe7e6a6f41e8f (patch)
treee9bd9fd450b0c00698999e70fcf1cfb320c35172 /pkgs/tools/networking/openvpn
parented02a770aef844fd4782e21685334d889e5ceffd (diff)
downloadnixpkgs-ea1caf92725f72c8cb1a0f68c54fe7e6a6f41e8f.tar
nixpkgs-ea1caf92725f72c8cb1a0f68c54fe7e6a6f41e8f.tar.gz
nixpkgs-ea1caf92725f72c8cb1a0f68c54fe7e6a6f41e8f.tar.bz2
nixpkgs-ea1caf92725f72c8cb1a0f68c54fe7e6a6f41e8f.tar.lz
nixpkgs-ea1caf92725f72c8cb1a0f68c54fe7e6a6f41e8f.tar.xz
nixpkgs-ea1caf92725f72c8cb1a0f68c54fe7e6a6f41e8f.tar.zst
nixpkgs-ea1caf92725f72c8cb1a0f68c54fe7e6a6f41e8f.zip
openvpn: Optional pkcs11 support
Diffstat (limited to 'pkgs/tools/networking/openvpn')
-rw-r--r--pkgs/tools/networking/openvpn/default.nix21
1 files changed, 13 insertions, 8 deletions
diff --git a/pkgs/tools/networking/openvpn/default.nix b/pkgs/tools/networking/openvpn/default.nix
index e666cf7f605..3f4f1244e1b 100644
--- a/pkgs/tools/networking/openvpn/default.nix
+++ b/pkgs/tools/networking/openvpn/default.nix
@@ -1,4 +1,8 @@
-{ stdenv, fetchurl, iproute, lzo, openssl, pam, systemd, pkgconfig }:
+{ stdenv, fetchurl, iproute, lzo, openssl, pam, systemd, pkgconfig
+, pkcs11Support ? false, pkcs11helper ? null,
+}:
+
+assert pkcs11Support -> (pkcs11helper != null);
 
 with stdenv.lib;
 
@@ -13,13 +17,14 @@ stdenv.mkDerivation rec {
   patches = optional stdenv.isLinux ./systemd-notify.patch;
 
   buildInputs = [ lzo openssl pkgconfig ]
-                  ++ optionals stdenv.isLinux [ pam systemd iproute ];
-
-  configureFlags = optionalString stdenv.isLinux ''
-    --enable-systemd
-    --enable-iproute2
-    IPROUTE=${iproute}/sbin/ip
-  '';
+                  ++ optionals stdenv.isLinux [ pam systemd iproute ]
+                  ++ optional pkcs11Support pkcs11helper;
+
+  configureFlags = optionals stdenv.isLinux [
+    "--enable-systemd"
+    "--enable-iproute2"
+    "IPROUTE=${iproute}/sbin/ip" ]
+    ++ optional pkcs11Support "--enable-pkcs11";
 
   postInstall = ''
     mkdir -p $out/share/doc/openvpn/examples