diff --git a/modules/programs/bash/bash.nix b/modules/programs/bash/bash.nix index f2b0ac46b06a..9d52eeebf8e9 100644 --- a/modules/programs/bash/bash.nix +++ b/modules/programs/bash/bash.nix @@ -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 + /bin/sh. 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 '';