summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmily Trau <emily@downunderctf.com>2023-05-18 10:12:53 +1000
committerAdam Joseph <adam@westernsemico.com>2023-06-17 21:02:35 -0700
commit005cfc8b0cea9cef36a8d129c3b06e0a98a918da (patch)
tree3a02c714973e6b06a0fddbcef8af3ed6ef850cde
parent5799ed8639d5a6883da4b6f315f2cc61c874149d (diff)
downloadnixpkgs-005cfc8b0cea9cef36a8d129c3b06e0a98a918da.tar
nixpkgs-005cfc8b0cea9cef36a8d129c3b06e0a98a918da.tar.gz
nixpkgs-005cfc8b0cea9cef36a8d129c3b06e0a98a918da.tar.bz2
nixpkgs-005cfc8b0cea9cef36a8d129c3b06e0a98a918da.tar.lz
nixpkgs-005cfc8b0cea9cef36a8d129c3b06e0a98a918da.tar.xz
nixpkgs-005cfc8b0cea9cef36a8d129c3b06e0a98a918da.tar.zst
nixpkgs-005cfc8b0cea9cef36a8d129c3b06e0a98a918da.zip
minimal-bootstrap: create top-level attr for bootstrap sources
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/bootstrap-sources.nix22
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/hex0.nix2
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/kaem/minimal.nix2
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix28
-rw-r--r--pkgs/top-level/all-packages.nix1
5 files changed, 42 insertions, 13 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 f06db98a8ef..e7ddede2ffa 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
@@ -15,8 +15,7 @@ rec {
     executable = true;
   };
 
-  # Packaged resources required for the first bootstrapping stage.
-  # Contains source code and 256-byte hex0 binary seed.
+  # Packaged source files for the first bootstrapping stage.
   #
   # We don't have access to utilities such as fetchgit and fetchzip since this
   # is this is part of the bootstrap process and would introduce a circular
@@ -25,10 +24,25 @@ rec {
   # tarballs to be repackaged.
   #
   # To build see `make-bootstrap-sources.nix`
+
+  #
+  # Files came from this Hydra build:
+  #
+  #   https://hydra.nixos.org/build/<placeholder>
+  #
+  # Which used nixpkgs revision <placeholder>
+  # to instantiate:
+  #
+  #   /nix/store/<placeholder>.drv
+  #
+  # and then built:
+  #
+  #   /nix/store/<placeholder>
+  #
   src = import <nix/fetchurl.nix> {
     inherit name;
-    url = "https://github.com/emilytrau/bootstrap-tools-nar-mirror/releases/download/2023-05-02/${name}.nar.xz";
-    hash = "sha256-ZRG0k49MxL1UTZhuMTvPoEprdSpJRNVy8QhLE6k+etg=";
+    url = "https://github.com/emilytrau/bootstrap-tools-nar-mirror/releases/download/2023-05-18/${name}.nar.xz";
+    hash = "sha256-FpMp7z+B3cR3LkQ+PooH/b1/NlxH8NHVJNWifaPWt4U=";
     unpack = true;
   };
 }
diff --git a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/hex0.nix b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/hex0.nix
index 43859b966ad..b85b2f2cac1 100644
--- a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/hex0.nix
+++ b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/hex0.nix
@@ -9,7 +9,7 @@ derivationWithMeta {
   pname = "hex0";
   builder = hex0-seed;
   args = [
-    "${src}/bootstrap-seeds/POSIX/x86/hex0_x86.hex0"
+    "${src}/x86/hex0_x86.hex0"
     (placeholder "out")
   ];
 
diff --git a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/kaem/minimal.nix b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/kaem/minimal.nix
index e85efbbb024..24fc77f8d34 100644
--- a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/kaem/minimal.nix
+++ b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/kaem/minimal.nix
@@ -9,7 +9,7 @@ derivationWithMeta {
   pname = "kaem-minimal";
   builder = hex0;
   args = [
-    "${src}/bootstrap-seeds/POSIX/x86/kaem-minimal.hex0"
+    "${src}/x86/kaem-minimal.hex0"
     (placeholder "out")
   ];
 
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 fec03f370bc..be0974edf43 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
@@ -1,5 +1,4 @@
-# Packaged resources required for the first bootstrapping stage.
-# Contains source code and 256-byte hex0 binary seed.
+# Packaged source files for the first bootstrapping stage.
 #
 # We don't have access to utilities such as fetchgit and fetchzip since this
 # is this is part of the bootstrap process and would introduce a circular
@@ -9,23 +8,30 @@
 #
 # To build:
 #
-#   nix-build pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix
+#   nix-build . -A minimal-bootstrap-sources
 #   => ./result/stage0-posix-$version-$rev-source.nar.xz
 #
 
-{ pkgs ? import ../../../../.. {} }:
+{ lib
+, fetchFromGitHub
+, runCommand
+, nix
+, xz
+}:
 let
-  inherit (pkgs) callPackage runCommand fetchFromGitHub nix xz;
-
   inherit (import ./bootstrap-sources.nix) name rev;
 
   src = fetchFromGitHub {
     owner = "oriansj";
     repo = "stage0-posix";
     inherit rev;
-    sha256 = "sha256-ZRG0k49MxL1UTZhuMTvPoEprdSpJRNVy8QhLE6k+etg=";
+    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 \
@@ -40,6 +46,14 @@ runCommand name {
   nativeBuildInputs = [ nix xz ];
 
   passthru = { inherit src; };
+
+  meta = with lib; {
+    description = "Packaged sources for the first bootstrapping stage";
+    homepage = "https://github.com/oriansj/stage0-posix";
+    license = licenses.gpl3Plus;
+    maintainers = teams.minimal-bootstrap.members;
+    platforms = platforms.all;
+  };
 } ''
   mkdir $out
   nix-store --dump ${src} | xz -c > "$out/${name}.nar.xz"
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 607d824f4fa..761b4fdd0df 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -27441,6 +27441,7 @@ with pkgs;
     };
     checkMeta = callPackage ../stdenv/generic/check-meta.nix { };
   });
+  minimal-bootstrap-sources = callPackage ../os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix { };
 
   mingetty = callPackage ../os-specific/linux/mingetty { };