43197 Commits

Author SHA1 Message Date
Russell O'Connor
d4bd4650d6 Rework the knot-tying code for defining Haskell packages.
The existing knot-tying code I felt was a bit incoherent with result, finalReturn, self, refering to different various forms of the "haskellPackages" value and often
different forms in the same place.

This commit instills some object-oriented discipline to the construction of hasekllPackages using a small number of fundamental OO concepts:

* An class is a open recursive function of the form (self : fooBody) where fooBody is a set.
* An instance of a class is the fixed point of the class.
  This value is sometimes refered to as an object and the values in the resulting set are sometimes refered to as methods.
* A class, foo = self : fooBody, can be extended by an extension which is a function bar = (self : super : barBody) where barBody a set of overrides for fooBody.
  The result of a class extension is a new class whose value is self : foo self // bar self (foo self).
  The super parameter gives access to the original methods that barBody may be overriding.

This commit turns the haskell-packages value into a "class".

The knot-tying, a.k.a the object instanitation, is moved into haskells-defaults.  The "finalReturn" is no longer needed and is eliminated from the body of
haskell-packages. All the work done by prefFun is moved to haskell-defaults, so that parameter is eliminated form haskell-packages.  Notice that the old prefFun took
two pameters named "self" and "super", but both parameters got passed the same value "result".  There seems to have been some confusion in the old code.

Inside haskell-defaults, the haskell-packages class is extended twice before instantiation.  The first extension is done using prefFun argument.
The second extension is done the extension argument, which is a renamed version of extraPrefs.

This two stage approach means that extension's super gets access to the post "perfFun" object while previously the extraPrefs only had access to the pre "prefFun"
object.  Also the extension function has access to both the super (post "perfFun") object and to self, the final object.  With extraPrefs, one needed to use the
"finalReturn" of the haskell packages to get access to the final object.  Due to significant changes in semantics, I thought it best to replace extraPrefs with
extension so that people using extraPrefs know to update thier cod.

Lastly, all the Prefs functions have renamed the "self" parameter to "super".  This is because "self" was never actually a self-reference in the object oriented sense
of the word.  For example

    Cabal_1_18_1_3 = self.Cabal_1_18_1_3.override { deepseq = self.deepseq_1_3_0_2; };

doesn't actually make sense from an object oriented standpoint because, barring further method overriding, the value of Cabal_1_18_1_3 would be trying to override it's
own value which simply causes a loop exception.  Thankfully all these uses of self were really uses of super:

    Cabal_1_18_1_3 = super.Cabal_1_18_1_3.override { deepseq = super.deepseq_1_3_0_2; };

In this notation the overriden Cabal_1_18_1_3 method calls the Cabal_1_18_1_3 of the super-class, which is a well-founded notion.

Below is an example use of using "extension" parameter

{
  packageOverrides = pkgs : {
    testHaskellPackages = pkgs.haskellPackages.override {
      extension = self : super : {
        transformers_0_4_1_0 = self.cabal.mkDerivation (pkgs: {
        pname = "transformers";
        version = "0.4.1.0";
        sha256 = "0jlnz86f87jndv4sifg1zpv5b2g2cxy1x2575x727az6vyaarwwg";
        meta = {
          description = "Concrete functor and monad transformers";
          license = pkgs.stdenv.lib.licenses.bsd3;
          platforms = pkgs.ghc.meta.platforms;
          maintainers = [ pkgs.stdenv.lib.maintainers.andres ];
        };
       });

      transformers = self.transformers_0_4_1_0;

      lensFamilyCore = super.lensFamilyCore.override { transformers = self.transformers_0_3_0_0; };
     };
   };
 };
}

Notice the use of self in the body of the override of the transformers method which references the newly defined transformers_0_4_1_0 method.

With the previous code, one would have to instead akwardly write

      transformers = super.finalReturn.transformers_0_4_1_0;

or use a rec clause, which would prevent futher overriding of transformers_0_4_1_0.
2014-05-08 12:01:45 -04:00
Cillian de Róiste
aa5c229223 androidsdk: upgrade 22.3 -> 22.6.2 2014-05-08 00:49:19 +02:00
Austin Seipp
130cb5d005 criu: upgrade, hopefully fix Hydra build
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-05-07 16:43:48 -05:00
Peter Simons
c61d607340 tkgate: rewrite expressions to get along without the broken 'libiconvOrLibc' attribute 2014-05-07 23:11:51 +02:00
Peter Simons
8c75363c71 The logic behind 'libiconvOrLibc' is flawed and that attribute should be removed.
See https://github.com/NixOS/nixpkgs/pull/2532 for further details.
2014-05-07 23:11:51 +02:00
Austin Seipp
3b873648b3 coprthr: ensure we use the right perl
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-05-07 15:34:21 -05:00
Austin Seipp
ba085ee318 libevent: fix event_rpcgen.py
This should help fix the COPRTHR build. Although a Python dependency was
added, it was broken anyway...

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-05-07 15:34:21 -05:00
Rob Vermaas
31428612c2 Upgrade rtmpdump and get_iplayer 2014-05-07 20:56:37 +02:00
Peter Simons
366e3bd7a1 ghc-7.0.1: fix download URL 2014-05-07 20:33:32 +02:00
Peter Simons
b8bb480212 cabal-install: fix build of 1.20.0.1 with GHC 7.2.2 2014-05-07 19:13:06 +02:00
Peter Simons
4ee0cd2bbb haskell-gloss: Revert "update to version 1.8.2.1"
This reverts commit 37df971a49b6264894df2584c45a65a358f5fade. The new
version doesn't compile.
2014-05-07 19:13:06 +02:00
Peter Simons
ee1a03577c haskell-statistics: drop obsolete version 0.10.5.2 2014-05-07 19:13:06 +02:00
Peter Simons
fc51c1d163 cabal: enable the split-objects feature again for current versions of GHC 2014-05-07 19:13:06 +02:00
Peter Simons
bd36eadf98 haskell-zeromq4-haskell: update to version 0.6 2014-05-07 19:13:06 +02:00
Peter Simons
9acc4ccb29 haskell-yesod-test: update to version 1.2.1.5 2014-05-07 19:13:06 +02:00
Peter Simons
06d91b1f0e haskell-yesod-static: update to version 1.2.3 2014-05-07 19:13:06 +02:00
Peter Simons
5034c2b1f9 haskell-streaming-commons: update to version 0.1.2.3 2014-05-07 19:13:05 +02:00
Peter Simons
390b804b23 haskell-snap: update to version 0.13.2.5 2014-05-07 19:13:05 +02:00
Peter Simons
bb66957987 haskell-shelly: update to version 1.5.3 2014-05-07 19:13:05 +02:00
Peter Simons
ce57c7aac1 haskell-semigroupoids: update to version 4.0.2 2014-05-07 19:13:05 +02:00
Peter Simons
98c5572642 haskell-resourcet: update to version 1.1.2.2 2014-05-07 19:13:05 +02:00
Peter Simons
08549cdb02 haskell-network-multicast: update to version 0.0.11 2014-05-07 19:13:05 +02:00
Peter Simons
1ca94859d3 haskell-mmorph: update to version 1.0.3 2014-05-07 19:13:05 +02:00
Peter Simons
b127783bf4 haskell-largeword: update to version 1.2.3 2014-05-07 19:13:05 +02:00
Peter Simons
a688dd0687 haskell-language-c-inline: update to version 0.5.0.0 2014-05-07 19:13:05 +02:00
Peter Simons
de899153b1 haskell-criterion: update to version 0.8.1.0 2014-05-07 19:13:05 +02:00
Peter Simons
1ca4ac68d7 haskell-conduit: update to version 1.1.2.1 2014-05-07 19:13:05 +02:00
Peter Simons
d1fdb0cbb0 haskell-concurrent-extra: update to version 0.7.0.7 2014-05-07 19:13:05 +02:00
Peter Simons
2ac07cfc00 haskell-JuicyPixels: update to version 3.1.5.2 2014-05-07 19:13:05 +02:00
Peter Simons
8a446a01d7 haskell-HsSyck: update to version 0.52 2014-05-07 19:13:05 +02:00
Peter Simons
d43c34b6a4 haskell-derive: update to version 2.5.16 2014-05-07 19:13:05 +02:00
Peter Simons
23b0bb002b haskell-comonad: update to version 4.2 2014-05-07 19:13:05 +02:00
Peter Simons
efaac7c006 haskell-syb-0.4.1: disable the test suite when compiling with GHC HEAD
The test suite fails in a seemingly harmless way:

  ### Failure in: All:0
  expected: "(MyDataType Int,(DataType {tycon = \"MyDataType\", datarep = AlgRep [MyDataType]},(\"\",(\"MyDataType\",(\"\",\"MyDataType\")))))"
   but got: "(MyDataType Int,(DataType {tycon = \"Datatype.MyDataType\", datarep = AlgRep [MyDataType]},(\"\",(\"MyDataType\",(\"Datatype\",\"MyDataType\")))))"
2014-05-07 19:13:05 +02:00
Peter Simons
895a8648c9 haskell-yesod-core: update to version 1.2.15.1 2014-05-07 19:13:05 +02:00
Peter Simons
b45c5cdd32 haskell-transformers-compat: update to version 0.3 2014-05-07 19:13:04 +02:00
Peter Simons
00302921b3 haskell-resourcet: update to version 1.1.2.1 2014-05-07 19:13:04 +02:00
Peter Simons
7b52cc9676 haskell-pandoc-citeproc: update to version 0.3.1 2014-05-07 19:13:04 +02:00
Peter Simons
33c1a9599c haskell-optparse-applicative: update to version 0.8.1 2014-05-07 19:13:04 +02:00
Peter Simons
2fda5952a8 haskell-monad-logger: update to version 0.3.6.1 2014-05-07 19:13:04 +02:00
Peter Simons
0c60cac67f haskell-http-client: update to version 0.3.2.2 2014-05-07 19:13:04 +02:00
Peter Simons
375c29810d haskell-html-conduit: update to version 1.1.0.5 2014-05-07 19:13:04 +02:00
Peter Simons
8d6975cc75 haskell-hourglass: update to version 0.1.2 2014-05-07 19:13:04 +02:00
Peter Simons
32ca02ffac haskell-gtk-traymanager: update to version 0.1.4 2014-05-07 19:13:04 +02:00
Peter Simons
3f1571b5a1 haskell-distributive: update to version 0.4.4 2014-05-07 19:13:04 +02:00
Peter Simons
1b81577f09 haskell-contravariant: update to version 0.5.2 2014-05-07 19:13:04 +02:00
Peter Simons
6f5ee37d5c haskell-HTTP: update to version 4000.2.14 2014-05-07 19:13:04 +02:00
Peter Simons
715efa1948 R: don't recurse into the rPackages set to conserve memory and CPU time
The addition of CRAN has made "nix-env -qa \*" run ~30% longer than before [1].

[1] 0d264c1761
2014-05-07 19:12:15 +02:00
Eelco Dolstra
fae135b871 Installer test: Increase amount of RAM
On x86_64, 384 MB is not enough anymore for running "nix-env -i".

http://hydra.nixos.org/build/10865007
2014-05-07 18:24:15 +02:00
Eelco Dolstra
333bfe16c4 Containers: Support setting up macvlan interfaces
By setting a line like

  MACVLANS="eno1"

in /etc/containers/<name>.conf, the container will get an Ethernet
interface named mv-eno1, which represents an additional MAC address on
the physical eno1 interface. Thus the container has direct access to
the physical network. You can specify multiple interfaces in MACVLANS.

Unfortunately, you can't do this with wireless interfaces.

Note that dhcpcd is disabled in containers by default, so you'll
probably want to set

  networking.useDHCP = true;

in the container, or configure a static IP address.

To do: add a containers.* option for this, and a flag for
"nixos-container create".
2014-05-07 17:53:57 +02:00
Eelco Dolstra
6f7aaf10a5 Containers: Use systemd-nspawn's --network-veth flag
Note that this causes the name of the host-side interface to change
from c-<name> to ve-<name>.
2014-05-07 17:53:57 +02:00