summaryrefslogtreecommitdiff
path: root/pack
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-02-23 21:46:13 -0800
committerBen Sima <ben@bsima.me>2019-02-23 21:46:13 -0800
commit5dea32c8b804c24ee0bc8c75b14f93b43772b47f (patch)
tree2bd6d24e3c1ed742c53c18cc7b926311a68a1f6f /pack
parentf75eaf7fff963b88e412d315d0fdef8151943c20 (diff)
Get rid of cabal
Using just nix and ghc, ah it's so nice.
Diffstat (limited to 'pack')
-rw-r--r--pack/default.nix7
-rw-r--r--pack/ibb.nix51
-rw-r--r--pack/overlay.nix3
3 files changed, 36 insertions, 25 deletions
diff --git a/pack/default.nix b/pack/default.nix
index 255db4c..ee92fde 100644
--- a/pack/default.nix
+++ b/pack/default.nix
@@ -1,6 +1,7 @@
-self: super:
+{ nixpkgs ? import "${builtins.fetchTarball (import ./nixpkgs.nix)}" {}
+}:
{
- fathom = import ./fathom.nix { nixpkgs = super; };
- ibb = import ./ibb.nix { };
+ fathom = import ./fathom.nix { inherit nixpkgs; };
+ ibb = import ./ibb.nix { inherit nixpkgs; };
}
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}
+ '';
}
diff --git a/pack/overlay.nix b/pack/overlay.nix
new file mode 100644
index 0000000..b19eeb7
--- /dev/null
+++ b/pack/overlay.nix
@@ -0,0 +1,3 @@
+self: super:
+
+import ./default.nix { nixpkgs = super; }