Commit 06e21ebb authored by Artturin's avatar Artturin Committed by Emily Trau
Browse files

minimal-bootstrap: dont use top-level newScope to prevent accidentally using top-level attrs



Co-authored-by: default avatarEmily Trau <me@angus.ws>
parent 36559748
Loading
Loading
Loading
Loading
+19 −13
Original line number Diff line number Diff line
{ lib
, newScope
, stdenv
, config
, buildPlatform
, hostPlatform
}:

lib.makeScope newScope (self: with self; {
lib.makeScope
  # Prevent using top-level attrs to protect against introducing dependency on
  # non-bootstrap packages by mistake. Any top-level inputs must be explicitly
  # declared here.
  (extra: lib.callPackageWith ({ inherit lib config buildPlatform hostPlatform; } // extra))
  (self: with self; {
    fetchurl = import ../../../build-support/fetchurl/boot.nix {
    inherit (stdenv.buildPlatform) system;
      inherit (buildPlatform) system;
    };

    inherit (callPackage ./stage0-posix { }) kaem m2libc mescc-tools mescc-tools-extra writeTextFile writeText runCommand;
+3 −6
Original line number Diff line number Diff line
{ lib
, stdenv
, buildPlatform
, callPackage
, fetchurl
, kaem
, kaem-unwrapped
, mescc-tools
@@ -9,9 +8,7 @@
}:

let
  checkMeta = callPackage ../../../../stdenv/generic/check-meta.nix {
    inherit (stdenv) hostPlatform;
  };
  checkMeta = callPackage ../../../../stdenv/generic/check-meta.nix { };
in
rec {
  derivationWithMeta = attrs:
@@ -24,7 +21,7 @@ rec {
      validity.handled
      ({ inherit meta passthru; } // passthru)
      (derivation ({
        inherit (stdenv.buildPlatform) system;
        inherit (buildPlatform) system;
        inherit (meta) name;
      } // (builtins.removeAttrs attrs [ "meta" "passthru" ])));

+4 −1
Original line number Diff line number Diff line
@@ -26943,7 +26943,10 @@ with pkgs;
  metastore = callPackage ../os-specific/linux/metastore { };
  minimal-bootstrap = recurseIntoAttrs (callPackage ../os-specific/linux/minimal-bootstrap { });
  minimal-bootstrap = recurseIntoAttrs (import ../os-specific/linux/minimal-bootstrap {
    inherit (stdenv) buildPlatform hostPlatform;
    inherit lib config;
  });
  mingetty = callPackage ../os-specific/linux/mingetty { };