From ad083e2f00678b701908a34b41ef0f8ab07389ae Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Thu, 17 Aug 2023 09:42:44 -0400
Subject: [PATCH] get cabal-test and release from hs-flake-utils

---
 flake.lock |  8 ++++----
 flake.nix  | 21 ++++++---------------
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/flake.lock b/flake.lock
index 7b6553f..59b5ca3 100644
--- a/flake.lock
+++ b/flake.lock
@@ -358,11 +358,11 @@
         "pre-commit-hooks": "pre-commit-hooks"
       },
       "locked": {
-        "lastModified": 1686149618,
-        "narHash": "sha256-/IHWacNutk3tklouWOgClp7FnOH+Yk6If13kKJMSEi8=",
+        "lastModified": 1692187439,
+        "narHash": "sha256-m7c4EPFWmB1OmV3dSYQk2qtXR53xOjZdLCjMtzHSK34=",
         "ref": "main",
-        "rev": "49696f704eb965f57d729871c6d450ac0aff2b68",
-        "revCount": 12,
+        "rev": "408f3deab2e2f6ae60349776dde02c44f71fb386",
+        "revCount": 16,
         "type": "git",
         "url": "https://whetstone.private.storage/jcalderone/hs-flake-utils.git"
       },
diff --git a/flake.nix b/flake.nix
index e507137..f77dd86 100644
--- a/flake.nix
+++ b/flake.nix
@@ -91,21 +91,12 @@
 
       # Using the working directory of `nix run`, do a build with cabal and
       # then run the test suite.
-      apps.cabal-test = {
-        type = "app";
-        program = "${
-          pkgs.writeShellApplication {
-            name = "cabal-build-and-test";
-            runtimeInputs = with pkgs; [pkg-config haskell.compiler.${ghcVersion} cabal-install];
-
-            text = ''
-              nix run .#generate-cabal-project
-              cabal update hackage.haskell.org
-              cabal build
-              cabal run tests
-            '';
-          }
-        }/bin/cabal-build-and-test";
+      apps.cabal-test = hslib.apps.cabal-test {
+        preBuild = ''
+          nix run .#generate-cabal-project
+        '';
       };
+
+      apps.release = hslib.apps.release {};
     });
 }
-- 
GitLab