From 5dea32c8b804c24ee0bc8c75b14f93b43772b47f Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 23 Feb 2019 21:46:13 -0800 Subject: Get rid of cabal Using just nix and ghc, ah it's so nice. --- pack/ibb.nix | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'pack/ibb.nix') diff --git a/pack/ibb.nix b/pack/ibb.nix index ba4cae7..6d3e820 100644 --- a/pack/ibb.nix +++ b/pack/ibb.nix @@ -1,23 +1,30 @@ -{ compiler ? "ghc843" -, doHaddock ? false -, doBenchmark ? false -, doCheck ? true -, withHoogle ? false -, nixpkgs ? builtins.fetchTarball (import ./nixpkgs.nix) -}: - -with import "${nixpkgs}" {}; - -haskell.packages.${compiler}.developPackage { - root = ../.; - overrides = with haskell.lib; self: super: { - ghc = - if withHoogle - then super.ghc // {withPackages = super.ghc.withHoogle;} - else super.ghc; - ghcWithPackages = - if withHoogle - then self.ghc.withPackages - else super.ghcWithPackages; - }; +{ nixpkgs }: +with nixpkgs; +let + ghc = pkgs.haskell.packages.ghc844.ghcWithPackages (hp: with hp; [ + blaze-html + blaze-markup + bytestring + random + random-shuffle + scotty + shakespeare + text + ]); +in +stdenv.mkDerivation rec { + name = "ibb"; + version = "0"; + src = ../.; + nativeBuildInputs = [ + ghc + ]; + strictDeps = true; + buildPhase = '' + ${ghc}/bin/ghc -iapex -ilore -main-is Ibb --make apex/Ibb.hs -o bild/${name} + ''; + installPhase = '' + mkdir -p $out/bin + cp bild/${name} $out/bin/${name} + ''; } -- cgit v1.2.3