on master help sign in
Add an example how to use Ormolu straight from GitHub
db48697mrkkrp
README.md+24
@@ -53,6 +53,30 @@ packages:
53$ stack build
53$ stack build
54```
54```
55
55
56+To use Ormolu directly from GitHub with nix, this snippet may come in handy:
57+
58+```nix
59+# This overlay adds Ormolu straight from GitHub.
60+self: super:
61+
62+let source = super.fetchFromGitHub {
63+ owner = "tweag";
64+ repo = "ormolu";
65+ rev = "de279d80122b287374d4ed87c7b630db1f157642"; # update as necessary
66+ sha256 = "0qrxfk62ww6b60ha9sqcgl4nb2n5fhf66a65wszjngwkybwlzmrv"; # as well
67+ };
68+ ormolu = import source { pkgs = self; };
69+in {
70+ haskell = super.haskell // {
71+ packages = super.haskell.packages // {
72+ "${ormolu.ormoluCompiler}" = super.haskell.packages.${ormolu.ormoluCompiler}.override {
73+ overrides = ormolu.ormoluOverlay;
74+ };
75+ };
76+ };
77+}
78+```
79+
56## Usage
80## Usage
57
81
58The following will print the formatted output to the standard output.
82The following will print the formatted output to the standard output.