Add option "environment.binsh" to configure the shell executable used to create the global /bin/sh symlink.
This commit is contained in:
parent
04ba5de70a
commit
622a652411
1 changed files with 13 additions and 1 deletions
|
@ -58,6 +58,18 @@ let
|
|||
type = with pkgs.lib.types; bool;
|
||||
};
|
||||
|
||||
environment.binsh = mkOption {
|
||||
default = "${config.system.build.binsh}/bin/sh";
|
||||
example = "\${pkgs.dash}/bin/dash";
|
||||
type = with pkgs.lib.types; path;
|
||||
description = ''
|
||||
Select the shell executable that is linked system-wide to
|
||||
<literal>/bin/sh</literal>. Please note that NixOS assumes all
|
||||
over the place that shell to be Bash, so override the default
|
||||
setting only if you know exactly what you're doing.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
in
|
||||
|
@ -99,7 +111,7 @@ in
|
|||
# Create the required /bin/sh symlink; otherwise lots of things
|
||||
# (notably the system() function) won't work.
|
||||
mkdir -m 0755 -p /bin
|
||||
ln -sfn ${config.system.build.binsh}/bin/sh /bin/.sh.tmp
|
||||
ln -sfn "${config.environment.binsh}" /bin/.sh.tmp
|
||||
mv /bin/.sh.tmp /bin/sh # atomically replace /bin/sh
|
||||
'';
|
||||
|
||||
|
|
Loading…
Reference in a new issue