polysemy/flake.nix

53 lines
1.5 KiB
Nix
Raw Normal View History

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;
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
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";
"901" = hsPkgs unstable "ghc901";
"921" = hsPkgs unstable "ghc921";
};
mkPackages = version: {
"polysemy-${version}" = ghcs.${version}.polysemy;
"polysemy-plugin-${version}" = ghcs.${version}.polysemy-plugin;
2021-01-25 01:37:04 +03:00
};
2021-11-21 02:50:56 +03:00
packages =
foldl' (l: r: l // r) { inherit (ghcs."8107") polysemy polysemy-plugin; } (map mkPackages (attrNames ghcs));
2021-01-25 01:37:04 +03:00
2021-11-21 02:50:56 +03:00
mkDevShell = extra: ghc: ghc.shellFor {
packages = p: [p.polysemy p.polysemy-plugin];
buildInputs = with ghc; [
2021-01-25 01:37:04 +03:00
cabal-install
2021-11-21 02:50:56 +03:00
] ++ (if extra then [ghcid haskell-language-server] else []);
withHoogle = extra;
2021-01-25 01:37:04 +03:00
};
2021-11-21 02:50:56 +03:00
devShells = mapAttrs' (n: g: nameValuePair "ghc${n}" (mkDevShell (n != "921") g)) ghcs;
in {
inherit packages devShells;
defaultPackage = packages.polysemy;
devShell = devShells.ghc8107;
checks = packages;
2021-01-25 01:37:04 +03:00
});
}