@@ -316,54 +316,6 @@ convert those automatically into build instructions for Nix using the
316`cabal2nix` utility, which you can install into your profile by running
316`cabal2nix` utility, which you can install into your profile by running
317`nix-env -i cabal2nix`.
317`nix-env -i cabal2nix`.
319−## How to override a cabal package version for a specific compiler version
321−Say the default version of ghc-events is 0.4.4.0 and does not work with ghc784
322−We can override this by
324− $ mkdir .nixpkgs/haskell/ && cd .nixpkgs/haskell/
325− $ cabal get ghc-events-0.4.3.0 && cd ghc-events-0.4.3.0 && cabal2nix --no-check ghc-events.cabal > default.nix
327−in the config.nix we then override the packages
329− #overrides for every compiler versions
330− myHaskellPackages = hp : hp.override {
331− overrides = self: super: with pkgs.haskell.lib; {
335− myHaskellPackages784 = hp : hp.override {
336− overrides = self: super: with pkgs.haskell.lib; {
338− ghc-events = dontCheck (pkgs.haskell.packages.ghc784.callPackage ./haskell/ghc-events-0.4.3.0 {});
342− haskellngPackages = myHaskellPackages super.haskellPackages;
343− haskell784Packages = myHaskellPackages784(myHaskellPackages super.haskell.packages.ghc784);
345−We can then use those packages to build environments which will pick up the desired version
347− hs784 = haskell784Packages.ghcWithPackages (p: with p;
354− hs7101 = haskellngPackages.ghcWithPackages (p: with p;
360−as can be verified by
362− nix-store -qR $(nix-instantiate '<nixpkgs>' -A pkgs.hs784 ) | grep ghc-events
363− nix-store -qR $(nix-instantiate '<nixpkgs>' -A pkgs.hs7101) | grep ghc-events
367## How to build a stand-alone project
319## How to build a stand-alone project
369For example, let's assume that you're working on a private project called
321For example, let's assume that you're working on a private project called
@@ -479,6 +431,52 @@ following snippet in your `~/.nixpkgs/config.nix` file:
434+## How to override a cabal package version for a specific compiler version
436+Say the default version of ghc-events is 0.4.4.0 and does not work with ghc784
437+We can override this by
439+ $ mkdir .nixpkgs/haskell/ && cd .nixpkgs/haskell/
440+ $ cabal get ghc-events-0.4.3.0 && cd ghc-events-0.4.3.0 && cabal2nix --no-check ghc-events.cabal > default.nix
442+in the config.nix we then override the packages
444+ #overrides for every compiler versions
445+ myHaskellPackages = hp : hp.override {
446+ overrides = self: super: with pkgs.haskell.lib; {
450+ myHaskellPackages784 = hp : hp.override {
451+ overrides = self: super: with pkgs.haskell.lib; {
453+ ghc-events = dontCheck (pkgs.haskell.packages.ghc784.callPackage ./haskell/ghc-events-0.4.3.0 {});
457+ haskellngPackages = myHaskellPackages super.haskellPackages;
458+ haskell784Packages = myHaskellPackages784(myHaskellPackages super.haskell.packages.ghc784);
460+We can then use those packages to build environments which will pick up the desired version
462+ hs784 = haskell784Packages.ghcWithPackages (p: with p;
469+ hs7101 = haskellngPackages.ghcWithPackages (p: with p;
475+as can be verified by
477+ nix-store -qR $(nix-instantiate '<nixpkgs>' -A pkgs.hs784 ) | grep ghc-events
478+ nix-store -qR $(nix-instantiate '<nixpkgs>' -A pkgs.hs7101) | grep ghc-events
482## How to recover from GHC's infamous non-deterministic library ID bug
480## How to recover from GHC's infamous non-deterministic library ID bug
484GHC and distributed build farms don't get along well:
482GHC and distributed build farms don't get along well: