Include bashInteractive in nix-portable

This commit is contained in:
2026-03-06 12:42:09 +01:00
parent cbb7bbcddb
commit f961b7a5cb

View File

@@ -16,6 +16,8 @@ with builtins;
"openssh"
],
bashInteractive,
busybox,
cacert ? pkgs.cacert,
compression ? "zstd -19 -T0",
@@ -105,9 +107,10 @@ let
nixStatic = packStaticBin "${inp.nixStatic}/bin/nix";
proot = packStaticBin "${inp.proot}/bin/proot";
zstd = packStaticBin "${inp.zstd}/bin/zstd";
bash = packStaticBin "${inp.bashInteractive}/bin/bash";
# the default nix store contents to extract when first used
storeTar = maketar ([ cacert nix nixpkgsSrc ] ++ lib.optional (bundledPackage != null) bundledPackage);
storeTar = maketar ([ cacert nix nixpkgsSrc bash ] ++ lib.optional (bundledPackage != null) bundledPackage);
# The runtime script which unpacks the necessary files to $HOME/.nix-portable
@@ -253,6 +256,7 @@ let
${installBin proot "proot"}
${installBin bwrap "bwrap"}
${installBin nixStatic "nix"}
${installBin bash "bash"}
# install ssl cert bundle
unzip -poj "\$self" ${ lib.removePrefix "/" "${caBundleZstd}"} | \$dir/bin/zstd -d > \$dir/ca-bundle.crt
@@ -339,6 +343,7 @@ let
toBind="\$toBind \$dir/busybox/bin /bin"
# provide /bin/sh via the shipped busybox
toBind="\$toBind \$dir/busybox/bin/busybox /bin/sh"
toBind="\$toBind \$dir/bin/bash /bin/bash"
# on termux, make sure termux packages still work inside the nix-portable environment
if [ -n "\$TERMUX_VERSION" ]; then
@@ -634,6 +639,7 @@ let
$zip $out/bin/nix-portable.zip ${proot}/bin/proot
$zip $out/bin/nix-portable.zip ${zstd}/bin/zstd
$zip $out/bin/nix-portable.zip ${storeTar}/tar
$zip $out/bin/nix-portable.zip ${bash}/bin/bash
$zip $out/bin/nix-portable.zip ${caBundleZstd}
# create fingerprint