From 003725a97d50b3a9c918168f907d366bf4bac4ad Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Sat, 27 Jul 2024 10:11:42 -0700 Subject: [PATCH] freshBootstrapTools.bootstrapTools: extract as a package --- pkgs/stdenv/darwin/bootstrap-tools.nix | 25 +++++++++++++++++++++ pkgs/stdenv/darwin/make-bootstrap-tools.nix | 19 ++-------------- 2 files changed, 27 insertions(+), 17 deletions(-) create mode 100644 pkgs/stdenv/darwin/bootstrap-tools.nix diff --git a/pkgs/stdenv/darwin/bootstrap-tools.nix b/pkgs/stdenv/darwin/bootstrap-tools.nix new file mode 100644 index 000000000000..a3a9f17fb809 --- /dev/null +++ b/pkgs/stdenv/darwin/bootstrap-tools.nix @@ -0,0 +1,25 @@ +{ + lib, + stdenv, + bootstrapTools, + unpack, +}: + +builtins.derivation { + inherit (stdenv.hostPlatform) system; + + name = "bootstrap-tools"; + builder = "${unpack}/bin/bash"; + + args = [ + "${unpack}/bootstrap-tools-unpack.sh" + bootstrapTools + ]; + + PATH = lib.makeBinPath [ + (builtins.placeholder "out") + unpack + ]; + + allowedReferences = [ "out" ]; +} diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix index ff8299d139b8..0e47fbd8c4de 100644 --- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -291,23 +291,8 @@ rec { ''; }; - bootstrapTools = derivation { - inherit (stdenv.hostPlatform) system; - - name = "bootstrap-tools"; - builder = "${bootstrapFiles.unpack}/bin/bash"; - - args = [ - "${bootstrapFiles.unpack}/bootstrap-tools-unpack.sh" - bootstrapFiles.bootstrapTools - ]; - - PATH = lib.makeBinPath [ - (placeholder "out") - bootstrapFiles.unpack - ]; - - allowedReferences = [ "out" ]; + bootstrapTools = pkgs.callPackage ./bootstrap-tools.nix { + inherit (bootstrapFiles) bootstrapTools unpack; }; test = derivation {