summary refs log tree commit diff
path: root/pkgs/tools/misc/yubico-piv-tool/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/yubico-piv-tool/default.nix')
-rw-r--r--pkgs/tools/misc/yubico-piv-tool/default.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/tools/misc/yubico-piv-tool/default.nix b/pkgs/tools/misc/yubico-piv-tool/default.nix
index f081f94a147..39150cfed7e 100644
--- a/pkgs/tools/misc/yubico-piv-tool/default.nix
+++ b/pkgs/tools/misc/yubico-piv-tool/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, pkgconfig, openssl, pcsclite, check }:
+{ stdenv, fetchurl, pkgconfig, openssl, check, pcsclite, PCSC
+, withApplePCSC ? stdenv.isDarwin
+}:
 
 stdenv.mkDerivation rec {
   name = "yubico-piv-tool-2.0.0";
@@ -9,9 +11,10 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ openssl pcsclite check ];
+  buildInputs = [ openssl check ]
+    ++ (if withApplePCSC then [ PCSC ] else [ pcsclite ]);
 
-  configureFlags = [ "--with-backend=pcsc" ];
+  configureFlags = [ "--with-backend=${if withApplePCSC then "macscard" else "pcsc"}" ];
 
   meta = with stdenv.lib; {
     homepage = https://developers.yubico.com/yubico-piv-tool/;