busybox-sandbox-shell: fix eval for musl

Setting useMusl all the time to a condition dependent on isGnu meant
that for musl platforms, useMusl ended up being set to false, tripping
the assertion in the busybox expression.  The correct thing to do is
to leave useMusl at its default value, except for in the specific case
where we want to force it to true.

Fixes: 11472f0d1b ("busybox-sandbox-shell: replace pkgsStatic with useMusl")
This commit is contained in:
Alyssa Ross 2024-12-03 00:56:40 +01:00
parent 6369dcd132
commit 89f4dd9602
No known key found for this signature in database
GPG Key ID: 5B459184230FF0A2

View File

@ -1,12 +1,10 @@
{ lib, stdenv, busybox, musl }:
# Minimal shell for use as basic /bin/sh in sandbox builds
busybox.override {
busybox.override ({
enableStatic = true;
enableMinimal = true;
useMusl = stdenv.hostPlatform.isGnu && lib.meta.availableOn stdenv.hostPlatform musl;
extraConfig = ''
CONFIG_FEATURE_FANCY_ECHO y
CONFIG_FEATURE_SH_MATH y
@ -26,4 +24,6 @@ busybox.override {
CONFIG_ASH_PRINTF y
CONFIG_ASH_TEST y
'';
}
} // lib.optionalAttrs (stdenv.hostPlatform.isGnu && lib.meta.availableOn stdenv.hostPlatform musl) {
useMusl = true;
})