Browse Source

Add ormolu for linting

Ioannis Koutras 5 months ago
parent
commit
517863f2d7
3 changed files with 18 additions and 1 deletions
  1. 5 0
      nix/overlays.nix
  2. 12 0
      nix/sources.json
  3. 1 1
      shell.nix

+ 5 - 0
nix/overlays.nix

@@ -20,4 +20,9 @@
           );
     }
   )
+  (
+    _: super: {
+      ormolu = (import sources.ormolu {}).ormolu;
+    }
+  )
 ]

+ 12 - 0
nix/sources.json

@@ -22,5 +22,17 @@
         "type": "tarball",
         "url": "https://github.com/NixOS/nixpkgs-channels/archive/8731aaaf8b30888bc24994096db830993090d7c4.tar.gz",
         "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
+    },
+    "ormolu": {
+        "branch": "master",
+        "description": "A formatter for Haskell source code",
+        "homepage": null,
+        "owner": "tweag",
+        "repo": "ormolu",
+        "rev": "55d8b7f8c482655ea575425e55352e650f304ea0",
+        "sha256": "056sglg66v16ckilcsyc8p9w348spchilhwxh490jwcm01c50gz3",
+        "type": "tarball",
+        "url": "https://github.com/tweag/ormolu/archive/55d8b7f8c482655ea575425e55352e650f304ea0.tar.gz",
+        "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
     }
 }

+ 1 - 1
shell.nix

@@ -4,5 +4,5 @@ in pkgs.haskellPackages.shellFor
   {
     packages = p: [ p.listsToIpTables ];
     withHoogle = false;
-    buildInputs = [ pkgs.cabal-install pkgs.niv ];
+    buildInputs = [ pkgs.cabal-install pkgs.niv pkgs.ormolu ];
   }