diff --git a/cabal.project b/cabal.project deleted file mode 100644 index 78fa3af55a5c1c65dc617f30e2ced0b5e78c37f6..0000000000000000000000000000000000000000 --- a/cabal.project +++ /dev/null @@ -1,14 +0,0 @@ -packages: . - -- These aren't released on hackage yet so we have to grab them - -- straight from the vcs host. Probably should do some releases - -- soon. - https://whetstone.private.storage/privatestorage/tahoe-chk/-/archive/0.1.0.1/tahoe-chk-0.1.0.1.tar.gz - -tests: True - -package zlib - -- Turn on discovery of the underlying zlib using pkg-config. This - -- fixes build failures when the underlying zlib is not in the - -- traditional location but is discoverable with pkg-config. It might - -- break non-pkg-config platforms. - flags: +pkg-config diff --git a/flake.lock b/flake.lock index ecb55129cd1ea483fafb1bc5d2965e08974b4d89..cc4e271876731b0a439efc6906977e7346233167 100644 --- a/flake.lock +++ b/flake.lock @@ -147,11 +147,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1681762240, - "narHash": "sha256-+PLx9xHBvV70dA7Gy/+YTH1w3PcSOrGV0z0rGxts8jU=", + "lastModified": 1686149618, + "narHash": "sha256-/IHWacNutk3tklouWOgClp7FnOH+Yk6If13kKJMSEi8=", "ref": "main", - "rev": "a51e591b7fdf8881ac0237452691df7b1aceecd3", - "revCount": 10, + "rev": "49696f704eb965f57d729871c6d450ac0aff2b68", + "revCount": 12, "type": "git", "url": "https://whetstone.private.storage/jcalderone/hs-flake-utils.git" }, diff --git a/flake.nix b/flake.nix index cc2531248b496c8e322a472788860b38f0d8d648..83a55daf90f52f5b4226788555a4212847ba0f50 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,9 @@ in { checks = hslib.checks {}; devShells = hslib.devShells { + shellHook = '' + nix run .#generate-cabal-project + ''; extraBuildInputs = pkgs: with pkgs; [ zlib @@ -47,6 +50,27 @@ packages = hslib.packages {}; apps.hlint = hslib.apps.hlint {}; + apps.generate-cabal-project = { + type = "app"; + program = "${ + pkgs.writeShellApplication { + name = "generate-cabal-project"; + text = '' + cat >cabal.project.local <<EOF + -- This file is auto-generated by the flake devShell's shellHook. Do + -- not edit this file. Make changes in flake.nix. + tests: true + packages: + -- These aren't released on hackage yet so we have to get them + -- another way. Here, we get them from the Nix store. + -- tahoe-chk + ${tahoe-chk} + EOF + ''; + } + }/bin/generate-cabal-project"; + }; + # Using the working directory of `nix run`, do a build with cabal and # then run the test suite. apps.cabal-test = { @@ -57,6 +81,7 @@ runtimeInputs = with pkgs; [pkg-config haskell.compiler.${ghcVersion} cabal-install]; text = '' + nix run .#generate-cabal-project cabal update hackage.haskell.org cabal build all cabal run tests