Skip to content

Instantly share code, notes, and snippets.

@acowley
Created December 11, 2021 18:05
Show Gist options
  • Save acowley/f5154fe91c00523eb343ce8595e78ee9 to your computer and use it in GitHub Desktop.
Save acowley/f5154fe91c00523eb343ce8595e78ee9 to your computer and use it in GitHub Desktop.
Nix flake for building Frames-streamly
{
description = "Frames-streamly";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
hls.url = "github:haskell/haskell-language-server";
};
outputs = { self, nixpkgs, flake-utils, hls }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs {
inherit system;
};
compiler = "8107";
haskell = pkgs.haskell.packages."ghc${compiler}";
haskell-overlay = final: prev: {
streamly = (haskell.callHackage "streamly" "0.8.1.1" {}).overrideAttrs (old: {
buildInputs =
old.buildInputs or []++ pkgs.lib.optional pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.Cocoa
];
});
streamly-bytestring = haskell.callHackage "streamly-bytestring" "0.1.4" {
streamly = final.streamly;
};
relude = haskell.callHackage "relude" "1.0.0.1" {};
Frames-streamly = pkgs.haskell.lib.dontHaddock (haskell.callCabal2nix
"Frames-streamly"
(pkgs.fetchFromGitHub {
owner = "adamConnerSax";
repo = "Frames-streamly";
rev = "052edf6ce57f220e55a89c794d3869d2fb014dd8";
hash = "sha256-YDB6KF5CkBImRebaoQb/wIt3WV8OM5t+Ukiqm6JKmoM=";
})
{
relude = final.relude;
streamly = final.streamly;
streamly-bytestring = final.streamly-bytestring;
}
);
};
hspkgs = haskell.override {
overrides = haskell-overlay;
};
haskellEnv = hspkgs.ghc.withHoogle (ps: [ps.streamly ps.Frames-streamly]);
in {
devShell = pkgs.mkShell {
buildInputs = [
haskellEnv
hspkgs.cabal-install
# hls.packages.${system}."haskell-language-server-${compiler}"
];
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment