2 If user need access to more haskell package for building his
3 diagrams, he simply has to pass these package through the
4 extra packages function as follow in `config.nix`:
7 diagrams-builder.override {
8 extraPackages = self : [myHaskellPackage];
13 { lib, stdenv, ghcWithPackages, makeWrapper, diagrams-builder, extraPackages ? (self: []) }:
17 # Used same technique as for the yiCustom package.
18 wrappedGhc = ghcWithPackages
19 (self: [ diagrams-builder ] ++ extraPackages self);
20 ghc = lib.getExe' wrappedGhc "ghc";
22 exeWrapper = backend : ''
24 "${diagrams-builder}/bin/diagrams-builder-${backend}" "$out/bin/diagrams-builder-${backend}" \
25 --set NIX_GHC ${ghc} \
26 --set NIX_GHC_LIBDIR "$(${ghc} --print-libdir)"
29 backends = ["svg" "cairo" "ps"];
34 name = "diagrams-builder";
36 nativeBuildInputs = [ makeWrapper ];
38 buildCommand = lib.concatStringsSep "\n" (map exeWrapper backends);
40 # Will be faster to build the wrapper locally then to fetch it from a binary cache.
41 preferLocalBuild = true;
42 meta = diagrams-builder.meta;