{
description = "libtelnet-haskell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs: inputs.flake-utils.lib.eachDefaultSystem (system:
let
nixpkgs = import inputs.nixpkgs { inherit system; };
inherit (nixpkgs.haskell.packages) ghc884 ghc8107 ghc902 ghc922;
# Because the package is called libtelnet, we have to pass in
# its pkgconfig dependency explicitly. Also turn on the example.
makeLibtelnet = haskellPackages:
let
pkg = haskellPackages.callPackage ./libtelnet.nix {
inherit (nixpkgs) libtelnet;
};
in with nixpkgs.haskell.lib;
enableCabalFlag
(addBuildDepends pkg
(with haskellPackages; [monad-loops network-simple]))
"example";
in rec
{
defaultPackage = packages.ghc922;
packages = {
ghc884 = makeLibtelnet ghc884;
ghc8107 = makeLibtelnet ghc8107;
ghc902 = makeLibtelnet ghc902;
ghc922 = makeLibtelnet ghc922;
};
devShell = devShells.ghc922;
devShells = builtins.mapAttrs (_: v: v.env) packages;
}
);
}