about summary refs log tree commit diff
path: root/shell.nix
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-11-30T03·57-0500
committerGriffin Smith <root@gws.fyi>2019-11-30T03·57-0500
commit7d8ce026a2acc5a4d208110750be188f0ce5591c (patch)
tree7a2fc4080eae2b4c1280977fb0ea25b26b25ce96 /shell.nix
parent0abcd8c9581f0017cb2bd59a09e93800ea8f3b1f (diff)
Add DerivingVia newtype for generic arbitrary
Add a newtype, GenericArbitrary, which can be used with -XDerivingVia to
derive Arbitrary instances for types with Generic, via patching
generic-arbitrary to expose the underlying typeclass it uses for
surfacing the type information.
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/shell.nix b/shell.nix
index 966ab0bb0857..d1c2b7ad911a 100644
--- a/shell.nix
+++ b/shell.nix
@@ -8,7 +8,9 @@ let
     if compiler == "default"
     then pkgs.haskellPackages
     else pkgs.haskell.packages.${compiler}
-  );
+  ).override {
+    overrides = import ./haskell-overlay.nix { inherit nixpkgs; };
+  };
 
   haskellPackages = (
     if withHoogle
@@ -16,6 +18,10 @@ let
       overrides = (self: super: {
         ghc = super.ghc // { withPackages = super.ghc.withHoogle; };
         ghcWithPackages = self.ghc.withPackages;
+        # eww https://github.com/NixOS/nixpkgs/issues/16394
+        generic-arbitrary = pkgs.haskell.lib.appendPatch
+          super.generic-arbitrary
+          [ ./generic-arbitrary-export-garbitrary.patch ];
       });
     }
     else packageSet