diff --git a/pkgs/os-specific/linux/busybox/sandbox-shell.nix b/pkgs/os-specific/linux/busybox/sandbox-shell.nix index fa70e5f91d80c..5e3f5e624f689 100644 --- a/pkgs/os-specific/linux/busybox/sandbox-shell.nix +++ b/pkgs/os-specific/linux/busybox/sandbox-shell.nix @@ -1,9 +1,16 @@ -{ busybox}: +{ lib, stdenv, busybox, musl }: # Minimal shell for use as basic /bin/sh in sandbox builds busybox.override { enableStatic = true; enableMinimal = true; + + useMusl = + # We could probably switch to `glibc.static` for GNU hosts. But historically + # we've linked it against `musl` and it has the added benefit of significantly + # bringing down the binary size. + stdenv.hostPlatform.isGnu && lib.meta.availableOn stdenv.hostPlatform musl; + extraConfig = '' CONFIG_FEATURE_FANCY_ECHO y CONFIG_FEATURE_SH_MATH y diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 79dca219819a9..0f6144f7eda46 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26891,12 +26891,8 @@ with pkgs; bridge-utils = callPackage ../os-specific/linux/bridge-utils { }; busybox = callPackage ../os-specific/linux/busybox { }; - busybox-sandbox-shell = callPackage ../os-specific/linux/busybox/sandbox-shell.nix { - # musl roadmap has RISC-V support projected for 1.1.20 - busybox = if !stdenv.hostPlatform.isRiscV && !stdenv.hostPlatform.isLoongArch64 && stdenv.hostPlatform.libc != "bionic" - then pkgsStatic.busybox - else busybox; - }; + + busybox-sandbox-shell = callPackage ../os-specific/linux/busybox/sandbox-shell.nix { }; cachefilesd = callPackage ../os-specific/linux/cachefilesd { };