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
Option to create shell.nix from nix-shell arguments #1967
Comments
It might be also worth considering whether we want to edit the shell.nix file from currently running shell. For example, if I run |
I marked this as stale due to inactivity. → More info |
Sound like a great idea to me. I am constantly copy/paste the same basic shell.nix which is not that nice. |
I marked this as stale due to inactivity. → More info |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-do-nix-profiles-and-flakes-fit-together/28139/4 |
It is very easy to initiate a nix-environment through nix-shell that has a given set of derivations active. This is relatively easy to understand for new users and use right away. There are also a lot of tips and comments that rely on nix-shell's arguments.
The step from giving a derivation name in the command line (nix-shell -p python37) to creating a well formatted shell.nix is not small. It would be helpful for new users if there was an option or command for the nix-shell command that turns the current arguments into an equivalent shell.nix that has the same effect.
That way, a user can not only quickly recreate a previous environment, but can also learn how shell.nix files are supposed to look like and how packages and environment are connected together. This can be seen as both, a quality of life feature, as well as a mini-tutorial for nix-derivations.
Example:
Ref: nixpkgs #36634
The text was updated successfully, but these errors were encountered: