From 9585d245212572b2c599b3c10cfba545e42f46d1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 19 Feb 2016 14:21:47 +0100 Subject: Unified ghc version used across build --- default.nix | 14 ++++++++------ shell.nix | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/default.nix b/default.nix index 52ecd20..1dc1708 100644 --- a/default.nix +++ b/default.nix @@ -1,19 +1,21 @@ { pkgs ? (import {}) +, compilerName ? "ghc7103" }: rec { - thermoprint-spec = pkgs.haskellPackages.callPackage ./spec/thermoprint-spec.nix {}; - thermoprint-bbcode = pkgs.haskellPackages.callPackage ./tp-bbcode/thermoprint-bbcode.nix { + haskellPackages = pkgs.haskell.packages."${compilerName}"; + thermoprint-spec = haskellPackages.callPackage ./spec/thermoprint-spec.nix {}; + thermoprint-bbcode = haskellPackages.callPackage ./tp-bbcode/thermoprint-bbcode.nix { inherit bbcode thermoprint-spec; }; - thermoprint-client = pkgs.haskellPackages.callPackage ./client/thermoprint-client.nix { + thermoprint-client = haskellPackages.callPackage ./client/thermoprint-client.nix { inherit thermoprint-spec; }; thermoprint-server = pkgs.callPackage ./server/wrapped.nix { - inherit (pkgs.haskellPackages) ghcWithPackages; - thermoprint-server = pkgs.haskellPackages.callPackage ./server/thermoprint-server.nix { + inherit (haskellPackages) ghcWithPackages; + thermoprint-server = haskellPackages.callPackage ./server/thermoprint-server.nix { inherit thermoprint-spec thermoprint-client; }; }; - bbcode = pkgs.haskellPackages.callPackage ./bbcode/bbcode.nix {}; + bbcode = haskellPackages.callPackage ./bbcode/bbcode.nix {}; } diff --git a/shell.nix b/shell.nix index d6f2e43..f0a69b4 100644 --- a/shell.nix +++ b/shell.nix @@ -1,10 +1,10 @@ { pkgs ? (import {}) -, compilerName ? "ghc7103" +, haskellPackages ? (import ./default.nix {}).haskellPackages }: let thermoprintPackages = builtins.attrValues (import ./default.nix {}); - ghc = pkgs.haskell.packages.${compilerName}.ghcWithPackages + ghc = haskellPackages.ghcWithPackages (ps: thermoprintPackages ++ utilities ps ++ testDeps ps); utilities = (ps: with ps; [ hlint cabal2nix ]); testDeps = (ps: with ps; [ temporary hspec ]); -- cgit v1.2.3