2017-05-15 18:30:33 +03:00
|
|
|
{ pkgs }:
|
|
|
|
|
|
|
|
rec {
|
2018-02-05 19:28:27 +02:00
|
|
|
# Use "busybox-sandbox-shell" if present,
|
|
|
|
# if not (legacy) fallback and hope it's sufficient.
|
|
|
|
sh = pkgs.busybox-sandbox-shell or (pkgs.busybox.override {
|
2017-05-15 18:30:33 +03:00
|
|
|
useMusl = true;
|
|
|
|
enableStatic = true;
|
|
|
|
enableMinimal = true;
|
|
|
|
extraConfig = ''
|
2018-02-05 18:25:26 +02:00
|
|
|
CONFIG_FEATURE_FANCY_ECHO y
|
|
|
|
CONFIG_FEATURE_SH_MATH y
|
|
|
|
CONFIG_FEATURE_SH_MATH_64 y
|
|
|
|
|
2017-05-15 18:30:33 +03:00
|
|
|
CONFIG_ASH y
|
2018-02-05 18:25:26 +02:00
|
|
|
CONFIG_ASH_OPTIMIZE_FOR_SIZE y
|
|
|
|
|
|
|
|
CONFIG_ASH_ALIAS y
|
|
|
|
CONFIG_ASH_BASH_COMPAT y
|
|
|
|
CONFIG_ASH_CMDCMD y
|
2017-10-07 15:43:55 +03:00
|
|
|
CONFIG_ASH_ECHO y
|
2018-02-05 18:25:26 +02:00
|
|
|
CONFIG_ASH_GETOPTS y
|
|
|
|
CONFIG_ASH_INTERNAL_GLOB y
|
|
|
|
CONFIG_ASH_JOB_CONTROL y
|
|
|
|
CONFIG_ASH_PRINTF y
|
2017-10-07 15:43:55 +03:00
|
|
|
CONFIG_ASH_TEST y
|
2017-05-15 18:30:33 +03:00
|
|
|
'';
|
2018-02-05 19:28:27 +02:00
|
|
|
});
|
2017-05-15 18:30:33 +03:00
|
|
|
|
|
|
|
configureFlags =
|
|
|
|
[ "--disable-init-state"
|
|
|
|
"--enable-gc"
|
2017-05-30 16:56:15 +03:00
|
|
|
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
|
2017-05-15 18:30:33 +03:00
|
|
|
"--with-sandbox-shell=${sh}/bin/busybox"
|
|
|
|
];
|
|
|
|
}
|