From bb26366fea4460270a15962929e97597525d2c29 Mon Sep 17 00:00:00 2001 From: haslersn Date: Tue, 25 Jun 2019 23:17:28 +0200 Subject: [PATCH] nix-bundle.sh: Also take app-specific extra targets from the given FILE or default Previously, they were just taken from the `import {}` inside `./default.nix`. --- nix-bundle.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/nix-bundle.sh b/nix-bundle.sh index 4497ddb..f592db6 100755 --- a/nix-bundle.sh +++ b/nix-bundle.sh @@ -101,6 +101,18 @@ do shift done +# Add application-specific extra targets + +if [ "${targets[0]}" = "nix-bundle" ] || [ "${targets[0]}" = "nixStable" ] || [ "${targets[0]}" = "nixUnstable" ] || [ "${targets[0]}" = "nix" ] +then + targets+=("bash") + targets+=("bzip2") + targets+=("coreutils") + targets+=("gnutar") + targets+=("gzip") + targets+=("xz") +fi + # Create tmp directory for the links produced by `nix build` linkdir=$(mktemp -d) @@ -142,9 +154,7 @@ fi # Determine bootstrap function -- This seems like a total hack! bootstrap=nix-bootstrap -if [ "${targets[0]}" = "nix-bundle" ] || [ "${targets[0]}" = "nixStable" ] || [ "${targets[0]}" = "nixUnstable" ] || [ "${targets[0]}" = "nix" ]; then - bootstrap=nix-bootstrap-nix -elif ! [ -z "$extra_target_paths" ]; then +if ! [ -z "$extra_target_paths" ]; then bootstrap=nix-bootstrap-path fi