Michael Raskin wrote:

Author: raskin
-{stdenv, fetchurl, perl, bison, mktemp, kernel}:
+{stdenv, fetchurl, perl, bison, mktemp, kernel
+  , version ? "1.5"
+  , sha256 ?  "1izhf8kscjymsvsvhcqw9awnmp94vwv70zdj09srg9bkpjj0n017"
+  , subdir ? ""
+}:

I don't think this is a good idea, unless there is a very good reason for needing this kind of configurability. Generally, the package function should know how to build a package - the call site should only pass in the dependencies and feature flags.

If really needed, it would be better to pass a "src" argument rather than {version, sha256, subdir}.

-    klibc = import ../os-specific/linux/klibc {
+    klibc = composedArgsAndFun (import ../os-specific/linux/klibc) {
       inherit fetchurl stdenv perl bison mktemp kernel;
-    };
+    } null;

What does "composedArgsAndFun" do? (And it's almost certainly not a good name ;-) Also, I really dislike all those weird nulls in all-packages.nix.

--
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to