@@ -1,27 +1,26 @@
1−{ system ? builtins.currentSystem
2−, allPackages ? import ../../top-level/all-packages.nix
3−, platform ? null
4−, config ? {}
1+{ system ? builtins.currentSystem
2+, allPackages ? import ../../top-level/all-packages.nix
3+, platform ? null
4+, config ? {}
5+
6+# Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools
7+, bootstrapFiles ? let
8+ fetch = { file, sha256, executable ? true }: import <nix/fetchurl.nix> {
9+ url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/4f07c88d467216d9692fefc951deb5cd3c4cc722/${file}";
10+ inherit sha256 system executable;
11+ }; in {
12+ sh = fetch { file = "sh"; sha256 = "1siix3wakzil31r2cydmh3v8a1nyq4605dwiabqc5lx73j4xzrzi"; };
13+ bzip2 = fetch { file = "bzip2"; sha256 = "0zvqm977k11b5cl4ixxb5h0ds24g6z0f8m28z4pqxzpa353lqbla"; };
14+ mkdir = fetch { file = "mkdir"; sha256 = "13frk8lsfgzlb65p9l26cvxf06aag43yjk7vg9msn7ix3v8cmrg1"; };
15+ cpio = fetch { file = "cpio"; sha256 = "0ms5i9m1vdksj575sf1djwgm7zhnvfrrb44dxnfh9avr793rc2w4"; };
16+ tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "1lz1b0grl4642h6n635xvi6imf0yyy1zyzdr9ing5aphzz0z5iic"; executable = false; };
17+ }
518}:
619
720let
821 libSystemProfile = ''
922 (import "${./standard-sandbox.sb}")
1023 '';
11−
12− fetch = { file, sha256, executable ? true }: import <nix/fetchurl.nix> {
13− url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/4f07c88d467216d9692fefc951deb5cd3c4cc722/${file}";
14− inherit sha256 system executable;
15− };
16−
17− bootstrapFiles = {
18− sh = fetch { file = "sh"; sha256 = "1siix3wakzil31r2cydmh3v8a1nyq4605dwiabqc5lx73j4xzrzi"; };
19− bzip2 = fetch { file = "bzip2"; sha256 = "0zvqm977k11b5cl4ixxb5h0ds24g6z0f8m28z4pqxzpa353lqbla"; };
20− mkdir = fetch { file = "mkdir"; sha256 = "13frk8lsfgzlb65p9l26cvxf06aag43yjk7vg9msn7ix3v8cmrg1"; };
21− cpio = fetch { file = "cpio"; sha256 = "0ms5i9m1vdksj575sf1djwgm7zhnvfrrb44dxnfh9avr793rc2w4"; };
22− };
23−
24− tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "1lz1b0grl4642h6n635xvi6imf0yyy1zyzdr9ing5aphzz0z5iic"; executable = false; };
2524in rec {
2625 allPackages = import ../../top-level/all-packages.nix;
2726
@@ -42,13 +41,13 @@ in rec {
4241 '';
4342
4443 bootstrapTools = derivation rec {
45− inherit system tarball;
44+ inherit system;
4645
4746 name = "bootstrap-tools";
4847 builder = bootstrapFiles.sh; # Not a filename! Attribute 'sh' on bootstrapFiles
4948 args = [ ./unpack-bootstrap-tools.sh ];
5049
51− inherit (bootstrapFiles) mkdir bzip2 cpio;
50+ inherit (bootstrapFiles) mkdir bzip2 cpio tarball;
5251
5352 __sandboxProfile = binShClosure + libSystemProfile;
5453 };
@@ -306,4 +305,6 @@ in rec {
306305 inherit cc;
307306 };
308307 };
308+
309+ stdenvDarwin = stage5;
309310}