treewide: bash -> bashNonInteractive & bashInteractive -> bash#151227
treewide: bash -> bashNonInteractive & bashInteractive -> bash#151227Artturin wants to merge 3 commits intoNixOS:stagingfrom
Conversation
c3d266e to
5af1ecc
Compare
|
for some reason darwin stdenv.shellPackage broke |
|
if i remove |
works as a workaround |
|
Apologies for this substance-less drive-by comment, but I believe "noninteractive" would be the more widely used term. |
|
@dnadlinger No, yours is not just a substance-less drive-by comment. In fact this is a very important usability concern and the PR should not go ahead with the nonsensical made-up word “uninteractive”, but for sure use the valid dictionary word “noninteractive”. |
currently bashInteractive has noninteractive bash in its dependencies this fixes that
49d6b98 to
dc813a0
Compare
b8728a1 to
c7f066b
Compare
pkgs/shells/bash/4.4.nix
Outdated
There was a problem hiding this comment.
Maybe lowercase? It was lowercase before.
| name = "bash-${optionalString (!interactive) "Noninteractive-"}${version}-p${toString (builtins.length upstreamPatches)}"; | |
| name = "bash-${optionalString (!interactive) "noninteractive-"}${version}-p${toString (builtins.length upstreamPatches)}"; |
pkgs/shells/bash/5.1.nix
Outdated
stdenv changed due to
error: output '/nix/store/...-stdenv-linux' is not allowed to refer to the following paths:
/nix/store/...-ncurses-6.2
/nix/store/...-readline-8.1p0
/nix/store/...-bash-interactive-5.1-p12
c7f066b to
12a07be
Compare
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
Is this going anywhere? After a rabbit hole of discovery on this bashInteractive issue, having it be the default would have made nixos way easier and better for this noob. |
The status quo of `bash` not being interactive is frustrating for many users, because trying to use it interactively is just messed up, and `bashInteractive` is not intuitive and barely discoverable. This was brought to my (and many others) attention by @stahnma in his [talk at CfgMgmtCamp 2025](https://cfp.cfgmgmtcamp.org/ghent2025/talk/YUVUTN/), where he highlighted this as one of the frustrations he ran into when learning Nix. Why this is fine: - No reason for not making interactive the default was given in the original commit (6c6ff6f), but probably it was due to the increase in closure size - The closure size only increases by 6.9MiB (19.5%) today, with the added dependency on the store paths for readline and ncurses, which are needed on systems in almost all cases anyways - If somebody really needs to get a more minimal system, they can use the newly-introduced `bashNonInteractive` instead now - Though to apply it consistently, they'll need to do that in an overlay like ``` final: prev: { bash = self.bashNonInteractive; } ``` Or alternatively using the `system.replaceDependencies.replacements` NixOS option approach. While there's also other such `*Interactive` packages that could use the same treatment, `bash` is a great start. This was already attempted before in NixOS#151227, but was not continued for unknown reason. To avoid stdenv becoming bigger, all uses of bash in the (working) stdenv's are changed to the explicitly non-interactive version here. This commit will however still cause a mass rebuild for all packages (and reverse deps) making use of the default bash.
stdenv changed due to
error: output '/nix/store/...-stdenv-linux' is not allowed to refer to the following paths:
/nix/store/...-ncurses-6.2
/nix/store/...-readline-8.1p0
/nix/store/...-bash-interactive-5.1-p12
Motivation for this change
Closes #59209
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes