From 6a1b86abc1a65d0f92466ff3b13379fae9c01d59 Mon Sep 17 00:00:00 2001
From: Daniel Firth <dan.firth@homotopic.tech>
Date: Mon, 7 Nov 2022 17:23:30 +0000
Subject: [PATCH] libsodium: init at 1.0.18.2

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

diff --git a/configuration.nix b/configuration.nix
index 6c8a7c52..667a18d8 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -4,4 +4,6 @@ with pkgs.haskell.lib;
 
 final: prev: {
 
+  libsodium = prev.callPackage ./pkgs/libsodium.nix { inherit (pkgs) libsodium; };
+
 }
diff --git a/manifest.dhall b/manifest.dhall
index 3386b054..702e8894 100644
--- a/manifest.dhall
+++ b/manifest.dhall
@@ -369,6 +369,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 cada8dfc..9e9b0b54 100644
--- a/overlay.nix
+++ b/overlay.nix
@@ -475,6 +475,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