digitallyinduced/ihp

custom dependency

Closed this issue · 1 comments

how can we add a custom github repo/fork as a dependency to our app? I don't see an option if it's not on hackage

https://ihp.digitallyinduced.com/Guide/package-management.html#using-a-native-dependency

Is it a haskell package? Typically they still have a cabal file. So you can download the cabal file from the repo and then follow https://ihp.digitallyinduced.com/Guide/package-management.html#using-a-different-version-of-a-haskell-package (cabal2nix ./pathtocabalfile).

Here's an example nix file I have at Config/nix/haskell-packages/purebred-icu.nix:

{ mkDerivation, base, case-insensitive, lib, purebred
, purebred-email, text, text-icu, fetchFromGitHub
}:
mkDerivation {
  pname = "purebred-icu";
  version = "0.1.0.0";
  src = fetchFromGitHub {
    owner = "purebred-mua";
    repo = "purebred-icu";
    rev = "dc8addbc5e0bb79b58a25cc9351d8da1dbb25c1b";
    hash = "sha256-xQQO2joYUeRhKPrg+znnMFUwyM3vZeCACDxGbOtfoiw";
  };
  libraryHaskellDepends = [
    base case-insensitive purebred purebred-email text text-icu
  ];
  homepage = "https://github.com/purebred-mua/purebred-icu";
  description = "ICU charset support for purebred";
  license = lib.licenses.agpl3Plus;
}

Then I can just use the package in my flake.nix as usually.