summaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-10-27 09:48:52 -0700
committerBen Sima <ben@bsima.me>2019-10-27 12:14:40 -0700
commitc790672cc244ac4caba1bda3572829a6c6862891 (patch)
tree2706bb8044f7b14840c5f90f215b79b433e81045 /default.nix
parent44df4ba39f65c3afd84bee6b03f47d9b061e9038 (diff)
move everything to namespace directories
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix60
1 files changed, 55 insertions, 5 deletions
diff --git a/default.nix b/default.nix
index b894aa2..55f96e7 100644
--- a/default.nix
+++ b/default.nix
@@ -1,9 +1,59 @@
let
- nixpkgs-tar = builtins.fetchTarball (import ./pack/nixpkgs.nix);
+ nixpkgs-tar = builtins.fetchTarball (import ./nixpkgs.nix);
nixpkgs = import "${nixpkgs-tar}" {};
nixos = import "${nixpkgs-tar}/nixos";
-in
-{
- depo = import ./depo { inherit nixos; };
- pack = import ./pack { inherit nixpkgs; };
+
+ # a common build function
+ #
+ bild = file:
+ with nixpkgs;
+ let
+ pack = import file;
+
+ depsToPackageSet = packageSet: deps:
+ map (s: builtins.getAttr s packageSet) deps;
+
+ ghc844_ = pkgs.haskell.packages.ghc844.override (oldAttrs: {
+ overrides = with pkgs.haskell.lib; self: super: {
+ clay = dontCheck super.clay;
+ };
+ });
+
+ ghc = ghc844_.ghcWithPackages (hp: depsToPackageSet hp
+ # we need hinotify for chip/make
+ ([ "hinotify" ] ++ pack.deps.both ++ pack.deps.apex));
+
+ ghcjs_ = pkgs.haskell.packages.ghcjs.override (oldAttrs: {
+ overrides = with pkgs.haskell.lib; self: super: {
+ clay = dontCheck super.clay;
+ http-types = dontCheck super.http-types;
+ tasty-quickcheck = dontCheck super.tasty-quickcheck;
+ scientific = dontCheck super.scientific; # takes forever
+ servant = dontCheck super.servant;
+ comonad = dontCheck super.comonad;
+ QuickCheck = dontCheck super.QuickCheck;
+ };
+ });
+
+ ghcjs = ghcjs_.ghcWithPackages (hp:
+ depsToPackageSet hp (pack.deps.both ++ pack.deps.aero));
+
+ make = ./chip/make;
+ in stdenv.mkDerivation {
+ name = pack.name;
+ version = "0";
+ src = ../.;
+ nativeBuildInputs = [
+ ghc ghcjs
+ ];
+ strictDeps = true;
+ buildPhase = "${ghc}/bin/runhaskell ${make} ${pack.name}";
+ installPhase = ''
+ mkdir -p $out/bin
+ cp bild/${pack.name} $out/bin/${pack.name}
+ '';
+ };
+in {
+ com.simatime = import ./com/simatime.nix { inherit nixos; };
+ com.influencedbybooks = import ./com/influencedbybooks/default.nix {};
}