on master help sign in
nix-bundle.sh: Also take app-specific extra targets from the given FILE or default

Previously, they were just taken from the `import <nixpkgs> {}` inside `./default.nix`.

commitbb26366fea4460270a15962929e97597525d2c29 authorhaslersn <sebastian.hasler@gmx.net> dateTue 25 Jun 2019, 23:17 (7 years ago) parent3e54397
1 file changed+13−3
nix-bundle.sh+13−3
nix-bundle.sh+13−3
@@ -101,6 +101,18 @@ do
101101 shift
102102done
103103
104+# Add application-specific extra targets
105+
106+if [ "${targets[0]}" = "nix-bundle" ] || [ "${targets[0]}" = "nixStable" ] || [ "${targets[0]}" = "nixUnstable" ] || [ "${targets[0]}" = "nix" ]
107+then
108+ targets+=("bash")
109+ targets+=("bzip2")
110+ targets+=("coreutils")
111+ targets+=("gnutar")
112+ targets+=("gzip")
113+ targets+=("xz")
114+fi
115+
104116# Create tmp directory for the links produced by `nix build`
105117
106118linkdir=$(mktemp -d)
@@ -142,9 +154,7 @@ fi
142154# Determine bootstrap function -- This seems like a total hack!
143155
144156bootstrap=nix-bootstrap
145−if [ "${targets[0]}" = "nix-bundle" ] || [ "${targets[0]}" = "nixStable" ] || [ "${targets[0]}" = "nixUnstable" ] || [ "${targets[0]}" = "nix" ]; then
146− bootstrap=nix-bootstrap-nix
147−elif ! [ -z "$extra_target_paths" ]; then
157+if ! [ -z "$extra_target_paths" ]; then
148158 bootstrap=nix-bootstrap-path
149159fi
150160