nix-shell -p <some_pkg> not working with fish-shell #1131
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
Importance
High
Importance
Low
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
Release Blocking
Non-urgent
Release Blocking
Urgent
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
Urgency
High
Urgency
Low
ux
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#1131
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
nix-shell -p <some_pkg>doesn't work for myfishshell.The installed package is not available and the prompt doesn't indicate that the nix-shell is active.
nix shell nixpkgs#<some_pkg>works as expected.I have tried with Lix from nixpkgs
stable,latestandgitusing the "Advanced change" described here: https://lix.systems/add-to-config/Works on vanilla nix.
Steps To Reproduce
stable,latestorgitnix-shell -p <some_pkg>Expected behavior
I expected an indicator for the active nix-shell to appear and the package to be available. Like with
nix shellor vanilla nix.nix --versionoutputStable
Latest
Git
Additional context
fish-shell 4.4.0
Hi, thanks for the report. I believe we have a bunch of users who are running fish and are not reproducing your bug.
Could you provide
nix-shell -vvvvv -p a_package?@raito wrote in #1131 (comment):
Sure!
I investigated this issue, and the problem originates from commit
12b87538e+ following the instruction in NixOS wiki page to fish.The setup in wiki page configures bash to launch fish, if bash is an interactive shell and if the parent process is not fish. The commit that I mentioned changes the behavior of nix-shell from directly executing
execvpin the process into forking first and use the child process to exec the shell. As a result, the parent process is notfishanymore, butnix-shell.I find the fish bootstrap introduced in the wiki page is pretty hacky, because if we run
bashin a bash shell, we are gonna get fish shell instead. This is the "norm" in CppNix, but I don't really like this hack. I would prefer to just let my terminal start fish directly instead.One possible "solution" is to patch the rcfile generated for the nix-shell, so that
.bashrcis sourced after the variables setup (PATHetc.). This solution still starts fish, but has the package available. However, this changes the nix-shell semantic when compared to CppNix, since it now starts fish instead of bash.@raito would you like to discuss about how we want to solve this issue? I am willing to work on this
@s1syph0s Yes, absolutely. I'm just not super familiar with fish; what if we do the solution you suggest of patching the rcfile, how can we evaluate the semantical change has no impact on the rest of the ecosystem (direnv, devenv, etc.)?