Skip to content

Instantly share code, notes, and snippets.

@matthewess
Last active May 15, 2019 05:23
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 matthewess/6848331be03882a5998bf577253658cc to your computer and use it in GitHub Desktop.
Save matthewess/6848331be03882a5998bf577253658cc to your computer and use it in GitHub Desktop.
GHC_VER = ghc864
GHC_ARG = --argstr compiler $(GHC_VER)
IDE_ARG = --arg isIDE true
.PHONY: code
code: bugsy.cabal
nix-shell \
$(IDE_ARG) \
$(GHC_ARG) \
--run "code ."
# default.nix
{ compiler ? "latest" }:
let
nixpkgs = import <nixpkgs> {};
haskell = nixpkgs.pkgs.haskell;
packages = if compiler == "latest"
then nixpkgs.pkgs.haskellPackages
else haskell.packages."${compiler}";
in
packages.extend (haskell.lib.packageSourceOverrides {
bugsy = ./..;
})
# release.nix
{ compiler ? "default" }:
{ compiler ? "latest" }:
let
packages = import ./default.nix { compiler = compiler; };
in
{ bugsy = packages.bugsy;
}
# shell-WIP.nix
{ compiler ? "latest", isIDE ? false }:
let
packages = import ./default.nix { compiler = compiler; };
b = import ./brittany.nix {};
devPackages = p: if isIDE
then [p.hindent p.hlint b.brittany]
else [];
in
packages.shellFor {
packages = p: [p.bugsy] ++ (devPackages p);
withHoogle = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment