about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/softhsm/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/softhsm/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/softhsm/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/softhsm/default.nix b/nixpkgs/pkgs/tools/security/softhsm/default.nix
new file mode 100644
index 000000000000..ec5eea52a6f8
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/softhsm/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, botan, libobjc, Security }:
+
+stdenv.mkDerivation rec {
+
+  name = "softhsm-${version}";
+  version = "2.5.0";
+
+  src = fetchurl {
+    url = "https://dist.opendnssec.org/source/${name}.tar.gz";
+    sha256 = "1cijq78jr3mzg7jj11r0krawijp99p253f4qdqr94n728p7mdalj";
+  };
+
+  configureFlags = [
+    "--with-crypto-backend=botan"
+    "--with-botan=${botan}"
+    "--sysconfdir=$out/etc"
+    "--localstatedir=$out/var"
+    ];
+
+  propagatedBuildInputs =
+    stdenv.lib.optionals stdenv.isDarwin [ libobjc Security ];
+
+  buildInputs = [ botan ];
+
+  postInstall = "rm -rf $out/var";
+
+  meta = with stdenv.lib; {
+    homepage = https://www.opendnssec.org/softhsm;
+    description = "Cryptographic store accessible through a PKCS #11 interface";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.leenaars ];
+    platforms = platforms.unix;
+  };
+}