2021-01-25 01:37:04 +03:00
|
|
|
{
|
|
|
|
description = "Higher-order, low-boilerplate free monads.";
|
|
|
|
|
|
|
|
inputs = {
|
2023-12-29 02:24:38 +03:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/54ce5abce7e1531376455c7b32a195329c2587f0";
|
2023-09-01 02:23:33 +03:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2021-01-25 01:37:04 +03:00
|
|
|
};
|
|
|
|
|
2023-09-01 02:23:33 +03:00
|
|
|
outputs = {nixpkgs, flake-utils, ...}:
|
2021-01-25 01:37:04 +03:00
|
|
|
flake-utils.lib.eachSystem ["x86_64-linux"] (system:
|
2023-09-01 02:23:33 +03:00
|
|
|
with nixpkgs.lib;
|
2021-01-25 01:37:04 +03:00
|
|
|
let
|
2021-05-03 17:45:18 +03:00
|
|
|
hsPkgs = nixpkgs: compiler: import ./nix/overlay.nix { inherit system nixpkgs compiler; };
|
2021-01-25 01:37:04 +03:00
|
|
|
|
2021-11-21 02:50:56 +03:00
|
|
|
ghcs = {
|
2023-09-01 02:23:33 +03:00
|
|
|
"810" = hsPkgs nixpkgs "ghc810";
|
|
|
|
"90" = hsPkgs nixpkgs "ghc90";
|
|
|
|
"92" = hsPkgs nixpkgs "ghc92";
|
|
|
|
"94" = hsPkgs nixpkgs "ghc94";
|
|
|
|
"96" = hsPkgs nixpkgs "ghc96";
|
2023-12-29 02:24:38 +03:00
|
|
|
"98" = hsPkgs nixpkgs "ghc98";
|
2021-11-21 02:50:56 +03:00
|
|
|
};
|
|
|
|
|
2023-12-29 02:24:38 +03:00
|
|
|
default = "96";
|
|
|
|
|
2021-11-21 02:50:56 +03:00
|
|
|
mkPackages = version: {
|
|
|
|
"polysemy-${version}" = ghcs.${version}.polysemy;
|
|
|
|
"polysemy-plugin-${version}" = ghcs.${version}.polysemy-plugin;
|
2021-01-25 01:37:04 +03:00
|
|
|
};
|
|
|
|
|
2022-09-28 20:41:06 +03:00
|
|
|
defaultPackages = {
|
2023-12-29 02:24:38 +03:00
|
|
|
inherit (ghcs.${default}) polysemy polysemy-plugin;
|
|
|
|
default = ghcs.${default}.polysemy;
|
2022-09-28 20:41:06 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
packages = foldl' (l: r: l // r) defaultPackages (map mkPackages (attrNames ghcs));
|
2021-01-25 01:37:04 +03:00
|
|
|
|
2023-04-06 21:22:42 +03:00
|
|
|
mkDevShell = name: ghc: ghc.shellFor {
|
2021-11-21 02:50:56 +03:00
|
|
|
packages = p: [p.polysemy p.polysemy-plugin];
|
|
|
|
buildInputs = with ghc; [
|
2021-01-25 01:37:04 +03:00
|
|
|
cabal-install
|
2023-12-29 02:24:38 +03:00
|
|
|
] ++ nixpkgs.lib.optionals (name != "98" && name != "810") [
|
2022-12-27 15:35:31 +03:00
|
|
|
(ghc.pkgs.haskell.lib.dontCheck ghcid)
|
|
|
|
haskell-language-server
|
|
|
|
];
|
2021-01-25 01:37:04 +03:00
|
|
|
};
|
|
|
|
|
2023-04-06 21:22:42 +03:00
|
|
|
devShells = mapAttrs' (n: g: nameValuePair "ghc${n}" (mkDevShell n g)) ghcs;
|
2021-11-21 02:50:56 +03:00
|
|
|
|
|
|
|
in {
|
2022-09-28 20:41:06 +03:00
|
|
|
inherit packages;
|
2021-11-21 02:50:56 +03:00
|
|
|
|
2023-12-29 02:24:38 +03:00
|
|
|
devShells = devShells // { default = devShells."ghc${default}"; };
|
2021-11-21 02:50:56 +03:00
|
|
|
|
2021-05-03 17:45:18 +03:00
|
|
|
checks = packages;
|
2021-01-25 01:37:04 +03:00
|
|
|
});
|
|
|
|
}
|