1
1
mirror of https://github.com/google/ormolu.git synced 2024-11-27 13:13:23 +03:00
ormolu/default.nix

82 lines
1.7 KiB
Nix
Raw Normal View History

{ pkgs ? (import ./nix/nixpkgs) }:
let
2019-08-28 15:15:35 +03:00
ormoluCompiler = "ghc865";
source = pkgs.lib.sourceByRegex ./.[
"^.*\.md$"
"^app.*$"
"^data.*$"
"^ormolu.cabal$"
"^src.*$"
"^tests.*$"
];
haskellPackages = pkgs.haskell.packages.${ormoluCompiler}.override {
overrides = ormoluOverlay;
};
ormoluOverlay = self: super: {
2019-08-30 05:43:38 +03:00
"ormolu" = super.callCabal2nix "ormolu" source { };
};
ormolize = import ./nix/ormolize {
inherit pkgs;
inherit haskellPackages;
};
2019-08-30 05:43:38 +03:00
ormolizedPackages = doCheck:
pkgs.lib.mapAttrs (_: v: ormolize { package = v; inherit doCheck; }) haskellPackages;
in {
ormolu = haskellPackages.ormolu;
ormoluShell = haskellPackages.shellFor {
packages = ps: [ ps.ormolu ];
2019-08-06 14:29:50 +03:00
buildInputs = [ haskellPackages.cabal-install haskellPackages.ghcid ];
};
inherit ormoluOverlay ormoluCompiler;
2019-08-30 05:43:38 +03:00
hackage = ormolizedPackages false;
hackageTests = with pkgs.lib; pkgs.recurseIntoAttrs (
let ps = [
"QuickCheck"
"ShellCheck"
"aeson"
"attoparsec"
"aws"
2019-08-30 05:43:38 +03:00
"cassava"
"conduit"
"cryptonite"
"diagrams-core"
"distributed-process"
"esqueleto"
"fay"
"haxl"
2019-08-30 05:43:38 +03:00
"hedgehog"
"hlint"
"megaparsec"
"ormolu"
2019-08-30 05:43:38 +03:00
"postgrest"
"servant"
"servant-server"
"tensorflow"
"yesod-core"
2019-08-30 05:43:38 +03:00
# Comment idempotence issue
# "Agda"
# "brick"
# "hakyll"
# "hledger"
# "http-client"
# "idris"
# "intero"
# "leksah"
# "pandoc"
# "pipes"
# "stack"
# "tls"
# Missing language extension
# "lens" #fixed in master
# "purescript"
];
in listToAttrs (map (p: nameValuePair p (ormolizedPackages true).${p}) ps)
);
}