2019-08-16 13:02:00 +03:00
|
|
|
{ pkgs ? (import ./nix/nixpkgs) }:
|
|
|
|
|
2019-06-19 23:48:47 +03:00
|
|
|
let
|
2019-08-16 13:02:00 +03:00
|
|
|
ormoluCompiler = "ghc864";
|
2019-07-14 02:01:02 +03:00
|
|
|
source = pkgs.lib.sourceByRegex ./.[
|
|
|
|
"^.*\.md$"
|
|
|
|
"^app.*$"
|
|
|
|
"^data.*$"
|
|
|
|
"^ormolu.cabal$"
|
|
|
|
"^src.*$"
|
|
|
|
"^tests.*$"
|
|
|
|
];
|
2019-08-16 13:02:00 +03:00
|
|
|
haskellPackages = pkgs.haskell.packages.${ormoluCompiler}.override {
|
|
|
|
overrides = ormoluOverlay;
|
2019-06-19 23:48:47 +03:00
|
|
|
};
|
2019-08-16 13:02:00 +03:00
|
|
|
ormoluOverlay = self: super: {
|
|
|
|
"ormolu" = super.callCabal2nix "ormolu" source { };
|
|
|
|
};
|
2019-07-14 02:01:02 +03:00
|
|
|
ormolize = import ./nix/ormolize {
|
|
|
|
inherit pkgs;
|
|
|
|
inherit haskellPackages;
|
|
|
|
};
|
2019-06-19 23:48:47 +03:00
|
|
|
in {
|
|
|
|
ormolu = haskellPackages.ormolu;
|
2019-08-16 13:02:00 +03:00
|
|
|
ormoluShell = haskellPackages.shellFor {
|
2019-06-19 23:48:47 +03:00
|
|
|
packages = ps: [ ps.ormolu ];
|
2019-08-06 14:29:50 +03:00
|
|
|
buildInputs = [ haskellPackages.cabal-install haskellPackages.ghcid ];
|
2019-06-19 23:48:47 +03:00
|
|
|
};
|
2019-08-16 13:02:00 +03:00
|
|
|
inherit ormoluOverlay ormoluCompiler;
|
2019-07-14 02:01:02 +03:00
|
|
|
hackage = pkgs.lib.mapAttrs ormolize haskellPackages;
|
2019-06-19 23:48:47 +03:00
|
|
|
}
|