summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmily Trau <emily@downunderctf.com>2023-07-01 17:53:11 -0700
committerEmily Trau <emily@downunderctf.com>2023-07-01 17:54:33 -0700
commit37023bfde7e35079c93dcb65e85e99be18efefae (patch)
tree6e0e1a7904104dadf673c59022d1726f450383d9
parent51395b8fe244e3a41d6b75a198fcf6c5ad1dfebd (diff)
downloadnixpkgs-37023bfde7e35079c93dcb65e85e99be18efefae.tar
nixpkgs-37023bfde7e35079c93dcb65e85e99be18efefae.tar.gz
nixpkgs-37023bfde7e35079c93dcb65e85e99be18efefae.tar.bz2
nixpkgs-37023bfde7e35079c93dcb65e85e99be18efefae.tar.lz
nixpkgs-37023bfde7e35079c93dcb65e85e99be18efefae.tar.xz
nixpkgs-37023bfde7e35079c93dcb65e85e99be18efefae.tar.zst
nixpkgs-37023bfde7e35079c93dcb65e85e99be18efefae.zip
minimal-bootstrap: use recursive FOD to make nix unpack bootstrap sources
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/bootstrap-sources.nix21
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix53
2 files changed, 25 insertions, 49 deletions
diff --git a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/bootstrap-sources.nix b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/bootstrap-sources.nix
index 65b052c4456..9d4abdf2e51 100644
--- a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/bootstrap-sources.nix
+++ b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/bootstrap-sources.nix
@@ -29,7 +29,7 @@ rec {
 
   Run the following command:
   ```
-  nix hash file $(nix build --print-out-paths -f '<nixpkgs>' make-minimal-bootstrap-sources)
+  nix hash path $(nix build --print-out-paths -f '<nixpkgs>' make-minimal-bootstrap-sources)
   ```
 
   # Why do we need this `.nar` archive?
@@ -71,11 +71,11 @@ rec {
   requirements above apply to `minimal-bootstrap-sources`.
   */
   minimal-bootstrap-sources = derivation {
-    name = "${name}.nar.xz";
+    inherit name;
     system = builtins.currentSystem;
-    outputHashMode = "flat";
+    outputHashMode = "recursive";
     inherit outputHashAlgo;
-    outputHash = "sha256-ig988BiRTz92hhZZgKQW1tVPoV4aQ2D69Cq3wHvVgHg=";
+    outputHash = "sha256-FpMp7z+B3cR3LkQ+PooH/b1/NlxH8NHVJNWifaPWt4U=";
 
     # This builder always fails, but fortunately Nix will print the
     # "builder", which is really the error message that we want the
@@ -85,22 +85,13 @@ rec {
       #
       # Neither your store nor your substituters seems to have:
       #
-      #  ${name}.nar.xz
+      #  /nix/store/________________________________-${name}
       #
-      # Please obtain or create this file, give it exactly the name
-      # shown above, and then run the following command:
-      #
-      #   nix-store --add-fixed ${outputHashAlgo} ${name}.nar.xz
-      #
-      # You can create this file from an already-bootstrapped nixpkgs
+      # You can create this path from an already-bootstrapped nixpkgs
       # using the following command:
       #
       #   nix-build '<nixpkgs>' -A make-minimal-bootstrap-sources
       #
-      # Or, if you prefer, you can create this file using only `git`,
-      # `nix`, and `xz`.  For the commands needed in order to do this,
-      # see `make-bootstrap-sources.nix`.
-      #
     '';
   };
 }
diff --git a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix
index 8951cc9ddbc..047c7740315 100644
--- a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix
+++ b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix
@@ -8,44 +8,31 @@
 #
 # To build:
 #
-#   nix-build '<nixpkgs>' -o sources.nar.xz -A make-minimal-bootstrap-sources
+#   nix-build '<nixpkgs>' -A make-minimal-bootstrap-sources
 #
 
 { lib
 , fetchFromGitHub
-, runCommand
-, nix
-, xz
 }:
-let
+fetchFromGitHub {
   inherit (import ./bootstrap-sources.nix { }) name rev;
+  owner = "oriansj";
+  repo = "stage0-posix";
+  sha256 = "sha256-FpMp7z+B3cR3LkQ+PooH/b1/NlxH8NHVJNWifaPWt4U=";
+  fetchSubmodules = true;
+  postFetch = ''
+    # Seed binaries will be fetched separately
+    echo "Removing seed binaries"
+    rm -rf $out/bootstrap-seeds/*
 
-  src = fetchFromGitHub {
-    owner = "oriansj";
-    repo = "stage0-posix";
-    inherit rev;
-    sha256 = "sha256-FpMp7z+B3cR3LkQ+PooH/b1/NlxH8NHVJNWifaPWt4U=";
-    fetchSubmodules = true;
-    postFetch = ''
-      # Seed binaries will be fetched separately
-      echo "Removing seed binaries"
-      rm -rf $out/bootstrap-seeds/*
-
-      # Remove vendored/duplicate M2libc's
-      echo "Removing duplicate M2libc"
-      rm -rf \
-        $out/M2-Mesoplanet/M2libc \
-        $out/M2-Planet/M2libc \
-        $out/mescc-tools/M2libc \
-        $out/mescc-tools-extra/M2libc
-    '';
-  };
-
-in
-runCommand "${name}.nar.xz" {
-  nativeBuildInputs = [ nix xz ];
-
-  passthru = { inherit src; };
+    # Remove vendored/duplicate M2libc's
+    echo "Removing duplicate M2libc"
+    rm -rf \
+      $out/M2-Mesoplanet/M2libc \
+      $out/M2-Planet/M2libc \
+      $out/mescc-tools/M2libc \
+      $out/mescc-tools-extra/M2libc
+  '';
 
   meta = with lib; {
     description = "Packaged sources for the first bootstrapping stage";
@@ -54,6 +41,4 @@ runCommand "${name}.nar.xz" {
     maintainers = teams.minimal-bootstrap.members;
     platforms = platforms.all;
   };
-} ''
-  nix-store --dump ${src} | xz -c > $out
-''
+}