summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-07-11 17:38:54 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-07-11 17:38:54 -0400
commitc69282508c8788a41fddb3fd2e774fd0f734a8c5 (patch)
tree9fafad72164d115c00d50d0fee8ab7e803107ad1
parent37023bfde7e35079c93dcb65e85e99be18efefae (diff)
downloadnixpkgs-c69282508c8788a41fddb3fd2e774fd0f734a8c5.tar
nixpkgs-c69282508c8788a41fddb3fd2e774fd0f734a8c5.tar.gz
nixpkgs-c69282508c8788a41fddb3fd2e774fd0f734a8c5.tar.bz2
nixpkgs-c69282508c8788a41fddb3fd2e774fd0f734a8c5.tar.lz
nixpkgs-c69282508c8788a41fddb3fd2e774fd0f734a8c5.tar.xz
nixpkgs-c69282508c8788a41fddb3fd2e774fd0f734a8c5.tar.zst
nixpkgs-c69282508c8788a41fddb3fd2e774fd0f734a8c5.zip
Address my comments
1. Advice for manually assembling the bootstrap sources is restored.

2. Hash is no longer duplicated

3. More informative store path using `builtins.placeholder` is provided.
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/bootstrap-sources.nix14
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/make-bootstrap-sources.nix9
2 files changed, 18 insertions, 5 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 9d4abdf2e51..82ee4d12386 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
@@ -7,6 +7,7 @@ rec {
   version = "unstable-2023-05-02";
   rev = "3189b5f325b7ef8b88e3edec7c1cde4fce73c76c";
   outputHashAlgo = "sha256";
+  outputHash = "sha256-FpMp7z+B3cR3LkQ+PooH/b1/NlxH8NHVJNWifaPWt4U=";
 
   # This 256 byte seed is the only pre-compiled binary in the bootstrap chain.
   hex0-seed = import <nix/fetchurl.nix> {
@@ -74,8 +75,7 @@ rec {
     inherit name;
     system = builtins.currentSystem;
     outputHashMode = "recursive";
-    inherit outputHashAlgo;
-    outputHash = "sha256-FpMp7z+B3cR3LkQ+PooH/b1/NlxH8NHVJNWifaPWt4U=";
+    inherit outputHashAlgo outputHash;
 
     # This builder always fails, but fortunately Nix will print the
     # "builder", which is really the error message that we want the
@@ -85,13 +85,21 @@ rec {
       #
       # Neither your store nor your substituters seems to have:
       #
-      #  /nix/store/________________________________-${name}
+      #  ${builtins.placeholder "out"}
       #
       # 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`.  Once you have the manual
+      # result, do:
+      #
+      #   nix-store --add-fixed --recursive ${outputHashAlgo} ./${name}
+      #
+      # to add it to your store.
     '';
   };
 }
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 047c7740315..2675d055aec 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
@@ -14,11 +14,16 @@
 { lib
 , fetchFromGitHub
 }:
+
+let
+  expected = import ./bootstrap-sources.nix { };
+in
+
 fetchFromGitHub {
-  inherit (import ./bootstrap-sources.nix { }) name rev;
+  inherit (expected) name rev;
   owner = "oriansj";
   repo = "stage0-posix";
-  sha256 = "sha256-FpMp7z+B3cR3LkQ+PooH/b1/NlxH8NHVJNWifaPWt4U=";
+  sha256 = expected.outputHash;
   fetchSubmodules = true;
   postFetch = ''
     # Seed binaries will be fetched separately