@@ -1,20 +1,29 @@
1−{ lib, stdenv, fetchurl, fetchFromGitHub, fetchpatch, perl, curl, bzip2, sqlite, openssl ? null, xz
2−, pkgconfig, boehmgc, perlPackages, libsodium, brotli, boost, editline
3−, autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook_xsl_ns
4−, busybox-sandbox-shell
1+{ lib, fetchurl, fetchFromGitHub, callPackage
52, storeDir ? "/nix/store"
63, stateDir ? "/nix/var"
74, confDir ? "/etc"
8−, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp
9−, withAWS ? stdenv.isLinux || stdenv.isDarwin, aws-sdk-cpp
5+, boehmgc
106}:
117
128let
139
14− sh = busybox-sandbox-shell;
15−
16− common = { name, suffix ? "", src, includesPerl ? false, fromGit ? false }:
17− let nix = stdenv.mkDerivation rec {
10+common =
11+ { lib, stdenv, fetchurl, fetchpatch, perl, curl, bzip2, sqlite, openssl ? null, xz
12+ , pkgconfig, boehmgc, perlPackages, libsodium, brotli, boost, editline
13+ , autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook_xsl_ns
14+ , busybox-sandbox-shell
15+ , storeDir
16+ , stateDir
17+ , confDir
18+ , withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp
19+ , withAWS ? stdenv.isLinux || stdenv.isDarwin, aws-sdk-cpp
20+
21+ , name, suffix ? "", src, includesPerl ? false, fromGit ? false
22+
23+ }:
24+ let
25+ sh = busybox-sandbox-shell;
26+ nix = stdenv.mkDerivation rec {
1827 inherit name src;
1928 version = lib.getVersion name;
2029
@@ -144,7 +153,7 @@ in rec {
144153
145154 nix = nixStable;
146155
147− nix1 = common rec {
156+ nix1 = callPackage common rec {
148157 name = "nix-1.11.16";
149158 src = fetchurl {
150159 url = "http://nixos.org/releases/nix/${name}/${name}.tar.xz";
@@ -153,17 +162,21 @@ in rec {
153162
154163 # Nix1 has the perl bindings by default, so no need to build the manually.
155164 includesPerl = true;
165+
166+ inherit storeDir stateDir confDir boehmgc;
156167 };
157168
158− nixStable = common rec {
169+ nixStable = callPackage common rec {
159170 name = "nix-2.2";
160171 src = fetchurl {
161172 url = "http://nixos.org/releases/nix/${name}/${name}.tar.xz";
162173 sha256 = "63238d00d290b8a93925891fc9164439d3941e2ccc569bf7f7ca32f53c3ec0c7";
163174 };
175+
176+ inherit storeDir stateDir confDir boehmgc;
164177 };
165178
166− nixUnstable = lib.lowPrio (common rec {
179+ nixUnstable = lib.lowPrio (callPackage common rec {
167180 name = "nix-2.2${suffix}";
168181 suffix = "pre6600_85488a93";
169182 src = fetchFromGitHub {
@@ -173,6 +186,8 @@ in rec {
173186 sha256 = "1n5dp7p2lzpnj7f834d25k020v16gnnsm56jz46y87v2x7b69ccm";
174187 };
175188 fromGit = true;
189+
190+ inherit storeDir stateDir confDir boehmgc;
176191 });
177192
178193}