-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use nixpkgs#bashInteractive for dev-shell #3565
Conversation
src/nix/dev-shell.cc
Outdated
@@ -281,6 +284,40 @@ struct CmdDevShell : Common, MixEnvironment | |||
}; | |||
} | |||
|
|||
std::string getBashPath(ref<Store> store) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this function can be generalized to fetch any package. For example, it could be used by the Git fetcher to fetch nixpkgs#git
it git
is not installed. Although that's a bit tricky right now because libfetcher doesn't have access to libexpr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I start by taking out the SourceExprCommand from InstallableValue? Looks like all it's used for is state, getAutoArgs, and lockFlags, and it might be simpler for an Installable to be separate from a command. Then Installables could be used by InstallableCommands/fetchGit/dev-shell.
b7bd59e
to
ba7d7ed
Compare
Updated to just create a bashInteractive InstallableFlake. InstallableFlake will only call lockFlake once, but this will ultimately still call lockFlake twice, because the bashInteractive installable will call it a second time. Seems like preventing that would require being able to have a LockedFlake return a LockedFlake for one of its inputs, but not sure if that's possible right now. And then everything used by toStorePath might need to get moved to LockedFlake or somewhere in libexpr. |
Thanks, merged! I changed |
Instead of using system bash for dev-shell, uses nixpkgs#bashInteractive as discussed in #3107 (comment). If dev-shell is used for a flake with a toplevel nixpkgs input, it uses that nixpkgs per #3107 (comment).
Reused a lot of code from InstallableFlake - seems like that should maybe get factored out?
@matthewbauer