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

84 lines
1.8 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"
"cassava"
"conduit"
"cryptonite"
"diagrams-core"
"distributed-process"
"esqueleto"
"fay"
"hedgehog"
"hlint"
"megaparsec"
"postgrest"
"servant"
"servant-server"
"tensorflow"
# Comment idempotence issue
# "Agda"
# "aws"
# "brick"
# "hakyll"
# "haxl"
# "hledger"
# "http-client"
# "idris"
# "intero"
# "leksah"
# "lens"
# "ormolu"
# "pandoc"
# "pipes"
# "purescript"
# "stack"
# "tls"
# "yesod-core"
# Missing language extension
# "lens" #fixed in master
# "purescript"
];
in listToAttrs (map (p: nameValuePair p (ormolizedPackages true).${p}) ps)
);
}