Skip to content

nix-build: support for non-bash shells with nix-build / nix-shell #498

@blueyed

Description

@blueyed

#355 (comment) mentions that you can use $NIX_BUILD_SHELL to specify the shell being used.

This does not work for zsh (and probably any non-bash shell) however:

% NIX_BUILD_SHELL=zsh nix-shell '<nixpkgs>' -A hello
zsh: no such option: rcfile

Source:

    $ENV{BASH_ENV} = $rcfile;
    my @args = ($ENV{NIX_BUILD_SHELL} // "bash");
    push @args, "--rcfile" if $interactive;

In #113 / ed09d0c, it was changed to use "bash" instead of $SHELL (by default).

Is it possible and worthwhile to add support for non-Bash shells?

This would also include patches to scripts like https://github.com/NixOS/nix/blob/master/dev-shell then probably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions