A Haskell package is available in nixpkgs, but I need it compiled with non-default options. What’s a good way to accomplish this?
Background: I’m using gitit. This package provides both an executable and a library. In order to use plugins, I need to compile gitit with plugin support. Below are the ideas I’ve come up with, in order of increasing appeal.
Clone the gitit repo and compile it on my machine with the desired option.
Cons: I’d have to manually check periodically for updates and pull them from the primary repo.
Create a local Haskell project that contains a copy of the “main program” (which is essentially an executable wrapper for the library) from the gitit repo. Add a dependency on the gitit library. Now I can compile the executable with any options I need.
Cons: I’d still have to manually check periodically for updates, but only to the main program.
Write a new Nix derivation or flake that downloads the gitit source code from the repo and compiles it with the options that I want. I guess I would copy the
callPackageexpression for gitit from hackage-packages.nix and modify it accordingly.
Is there a better option? Is there by any chance a one-liner to specify a dependency on a package from nixpkgs, but compiled with different options?