Skip to content

Instantly share code, notes, and snippets.

@luochen1990
Created July 7, 2022 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luochen1990/2fec87b6c5f2a55efa4e4163e0e05630 to your computer and use it in GitHub Desktop.
Save luochen1990/2fec87b6c5f2a55efa4e4163e0e05630 to your computer and use it in GitHub Desktop.
An easy Haskell develop environment (useage: nix develop)
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
hpkgs = pkgs.haskell.packages.ghc923;
in rec {
defaultPackage = hpkgs.callCabal2nix "haskell-dev" ./. { };
devShell = pkgs.haskell.lib.addBuildTools defaultPackage
(with hpkgs; [ haskell-language-server cabal-install ]);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment