2021-01-25 01:37:04 +03:00
|
|
|
{
|
|
|
|
description = "Higher-order, low-boilerplate free monads.";
|
|
|
|
|
|
|
|
inputs = {
|
2021-11-21 02:50:56 +03:00
|
|
|
nixpkgs_2009.url = github:nixos/nixpkgs/release-20.09;
|
|
|
|
nixpkgs_2105.url = github:nixos/nixpkgs/release-21.05;
|
2021-05-03 17:45:18 +03:00
|
|
|
unstable.url = github:nixos/nixpkgs/nixpkgs-unstable;
|
2021-01-25 01:37:04 +03:00
|
|
|
flake-utils.url = github:numtide/flake-utils;
|
|
|
|
};
|
|
|
|
|
2021-11-21 02:50:56 +03:00
|
|
|
outputs = { nixpkgs_2009, nixpkgs_2105, unstable, flake-utils, ... }:
|
2021-01-25 01:37:04 +03:00
|
|
|
flake-utils.lib.eachSystem ["x86_64-linux"] (system:
|
2021-11-21 02:50:56 +03:00
|
|
|
with unstable.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 = {
|
|
|
|
"865" = hsPkgs nixpkgs_2009 "ghc865";
|
|
|
|
"884" = hsPkgs nixpkgs_2105 "ghc884";
|
|
|
|
"8107" = hsPkgs unstable "ghc8107";
|
2022-09-28 20:41:06 +03:00
|
|
|
"902" = hsPkgs unstable "ghc902";
|
2022-12-27 15:35:31 +03:00
|
|
|
"925" = hsPkgs unstable "ghc925";
|
|
|
|
"943" = hsPkgs unstable "ghc943";
|
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 = {
|
|
|
|
inherit (ghcs."902") polysemy polysemy-plugin;
|
|
|
|
default = ghcs."902".polysemy;
|
|
|
|
};
|
|
|
|
|
|
|
|
packages = foldl' (l: r: l // r) defaultPackages (map mkPackages (attrNames ghcs));
|
2021-01-25 01:37:04 +03:00
|
|
|
|
2022-12-27 15:35:31 +03:00
|
|
|
mkDevShell = 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
|
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
|
|
|
};
|
|
|
|
|
2022-12-27 15:35:31 +03:00
|
|
|
devShells = mapAttrs' (n: g: nameValuePair "ghc${n}" (mkDevShell 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
|
|
|
|
2022-09-28 20:41:06 +03:00
|
|
|
devShells = devShells // { default = devShells.ghc902; };
|
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
|
|
|
});
|
|
|
|
}
|