Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aveltras
Created October 5, 2020 16:00
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 aveltras/9c463c4578cfd5687a0f694e3155a2db to your computer and use it in GitHub Desktop.
Save aveltras/9c463c4578cfd5687a0f694e3155a2db to your computer and use it in GitHub Desktop.
{ haskellNix ? import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz") {}
, nixpkgsSrc ? haskellNix.sources.nixpkgs-2003
, nixpkgsArgs ? haskellNix.nixpkgsArgs
, pkgs ? import nixpkgsSrc nixpkgsArgs
}:
let
compiler = "ghc884";
githubTarball = owner: repo: rev:
builtins.fetchTarball { url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; };
pkgsUnstable = import (githubTarball "NixOS" "nixpkgs" "502845c3e31ef3de0e424f3fcb09217df2ce6df6") {};
project = pkgs.haskell-nix.project {
compiler-nix-name = compiler;
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "realworld";
src = ./.;
};
};
in {
shell = project.shellFor {
packages = ps: [ ps.realworld ];
exactDeps = true;
buildInputs = with pkgs.haskellPackages;
with pkgsUnstable.haskell.packages.${compiler}; [
cabal-install
haskell-language-server
];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment