From 13148d14ba1e84a590077226a3e755297fe0647f Mon Sep 17 00:00:00 2001
From: Daniel Firth <dan.firth@homotopic.tech>
Date: Sat, 5 Nov 2022 12:53:16 +0000
Subject: [PATCH] libsodium: init at 1.0.18.2

---
 manifest.dhall     |  1 +
 overlay.nix        |  2 ++
 pkgs/libsodium.nix | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+)
 create mode 100644 pkgs/libsodium.nix

diff --git a/manifest.dhall b/manifest.dhall
index 1ab55ad4..086e57c7 100644
--- a/manifest.dhall
+++ b/manifest.dhall
@@ -352,6 +352,7 @@ in  [ callHackage "Cabal" "3.8.1.0"
     , callHackage "lens" "5.2"
     , callHackage "lens-aeson" "1.2.1"
     , callHackage "lens-family-th" "0.5.2.1"
+    , callHackage "libsodium" "1.0.18.2"
     , callHackage "libyaml" "0.1.2"
     , callHackage "lifted-async" "0.10.2.1"
     , callHackage "lifted-base" "0.2.3.12"
diff --git a/overlay.nix b/overlay.nix
index 46ee22be..1470930e 100644
--- a/overlay.nix
+++ b/overlay.nix
@@ -441,6 +441,8 @@ final: prev: with pkgs.haskell.lib; {
 
   lens-family-th = prev.callPackage (./pkgs/lens-family-th.nix) { };
 
+  libsodium = prev.callPackage (./pkgs/libsodium.nix) { };
+
   libyaml = prev.callPackage (./pkgs/libyaml.nix) { };
 
   lifted-async = prev.callPackage (./pkgs/lifted-async.nix) { };
diff --git a/pkgs/libsodium.nix b/pkgs/libsodium.nix
new file mode 100644
index 00000000..6ea1dc54
--- /dev/null
+++ b/pkgs/libsodium.nix
@@ -0,0 +1,41 @@
+{ mkDerivation
+, base
+, c2hs
+, hedgehog
+, lib
+, libsodium
+, tasty
+, tasty-hedgehog
+, tasty-hunit
+}:
+mkDerivation {
+  pname = "libsodium";
+  version = "1.0.18.2";
+  sha256 = "9cc7620f019993b04019df6a2563831beee2eb93b45431fad728c63be7312108";
+  isLibrary = true;
+  isExecutable = false;
+  enableSeparateDataOutput = false;
+  libraryHaskellDepends = [ base ];
+  libraryPkgconfigDepends = [ libsodium ];
+  libraryToolDepends = [ c2hs ];
+  testHaskellDepends = [
+    base
+    hedgehog
+    tasty
+    tasty-hedgehog
+    tasty-hunit
+  ];
+  testPkgconfigDepends = [ libsodium ];
+  testToolDepends = [ c2hs ];
+  enableLibraryProfiling = false;
+  enableExecutableProfiling = false;
+  doHaddock = false;
+  jailbreak = true;
+  doCheck = false;
+  doBenchmark = false;
+  hyperlinkSource = false;
+  homepage = "https://github.com/k0001/hs-libsodium";
+  description = "Low-level bindings to the libsodium C library";
+  license = lib.licenses.isc;
+  broken = false;
+}
-- 
GitLab