Skip to content

Rename 'nix shell' #4715

Description

@edolstra

The nix shell command replaces nix-shell -p to provide a shell in which the specified packages are available. However, the name nix shell is confusing since there are also development shells (created by nix develop), which this isn't; and the old nix-shell by default does start a development shell. So we should come up with a better name. Some suggestions have been made:

  • nix load nixpkgs#git - "load" a package into the current shell. This one mainly makes sense in the context of updating the current shell, rather than starting a subshell.
  • nix push nixpkgs#git / nix pop - update the current shell to add a package to the environment (similar to pushd / popd)
  • nix use nixpkgs#git - "use" is probably too ambiguous though.
  • nix add nixpkgs#git - probably sounds too permanent.
  • nix bonk nixpkgs#git - random name with no connotations that forces people to read the manpage.

Activity

  1. added
    UXThe way in which users interact with Nix. Higher level than UI.
    on Apr 16, 2021
  2. added this to the nix-2.4 milestone on Apr 16, 2021
  3. self-assigned this
    on Apr 16, 2021
  4. nixos-discourse commented on Apr 16, 2021

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/how-to-invoke-nix-shell-p-for-packages-not-in-nixpkgs/12475/6

  5. nixinator commented on Apr 16, 2021

    @nixinator
    Member

    nix inate nixpkgs#git

    but then again, I'm biased... and a robot from the future.

  6. raboof commented on Apr 16, 2021

    @raboof
    Member

    I actually quite like nix shell: it nicely indicates that the command affects the 'current shell', and does not have 'side effects' (using the term loosely). I'm not sure the confusion with development shells is such a problem: it's clear for regular users that nix shell is the one they need, and when developers learn about nix develop they're likely already familiar with nix shell, so that might be smooth enough.

    I like push/pop because it makes it clearer you can 'nest' shells, but it's not so clear "what is pushed on what" and where that change is 'visible', so I'm not sure it's a net improvement.

    nix enter might be another option, as you're 'entering' an environment with different behavior.

  7. andir commented on Apr 16, 2021

    @andir
    Member

    Wasn't this already replaced with nix run?

  8. bjornfor commented on Apr 16, 2021

    @bjornfor
    Contributor

    An idea: adding another command level to disambiguate: nix add <where>, i.e. nix add [new-shell|this-shell|user-profile|global-system]

    I used add here, but other verbs also work well with the explicit 3rd argument.

  9. edolstra commented on Apr 16, 2021

    @edolstra
    MemberAuthor

    Wasn't this already replaced with nix run?

    No, nix run doesn't start a shell, it directly runs the specified app or the default program from a package.

    nix enter might be another option, as you're 'entering' an environment with different behavior.

    Maybe nix enter could be the subshell variant of nix load.

  10. abathur commented on Apr 16, 2021

    @abathur
    Member

    I recall joking (to myself? in public? I'd have to go look...) that nix snowglobe would be groan-inducingly perfect.

  11. MatthewCroughan commented on Apr 16, 2021

    @MatthewCroughan
    Contributor

    nix inate nixpkgs#git

    but then again, I'm biased... and a robot from the future.

    Either bonk or inate would cause the user to read the manpage. I like both. nix inate just sounds too cool and is my preference.

    A custom suggestion of my own would be nix actualize, although nix inate already kind of implies that in the same way - 'bringing something into existence'.

  12. MatthewCroughan commented on Apr 16, 2021

    @MatthewCroughan
    Contributor

    If spelt with two n's, innate is actually a word. It could imply that the shell is the innate behavior/feature of nix, that you can run a nix shell on anything.

    It could imply that everything is built from a shell.

    Innate - An innate quality or ability is one that you were born with
    Innatism - A philosophical and epistemological doctrine that holds that the mind is born with ideas/knowledge

    nix innate - I love it..

  13. rjpcasalino commented on Apr 17, 2021

    @rjpcasalino

    nix insert

    nix shove

  14. das-g commented on Apr 17, 2021

    @das-g
    Member

    No, nix run doesn't start a shell

    On Nix 2.3.10 without flakes nix run ... does start a shell.

  15. 178 remaining items

  16. Qyriad commented on Jan 6, 2024

    @Qyriad
    Member

    I use nix with as the name for a convenience alias for nix shell with some extra arguments, so @jzbor's suggestion makes a lot of sense to me.

  17. moved this from To triage to ⚖ To discuss in Nix teamon Jan 12, 2024
  18. carlthome commented on Jan 17, 2024

    @carlthome
    Member

    nix environment maybe?

  19. moved this from Accepted work to In discussion in Nix implementation boardon Feb 29, 2024
  20. moved this from In discussion to Defined work in Nix implementation boardon Mar 19, 2024
  21. moved this from Defined work to In discussion in Nix implementation boardon Mar 28, 2024
  22. nixos-discourse commented on Apr 17, 2024

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/2024-04-10-nix-team-meeting-138/43585/1

  23. removed their assignment
    on Apr 26, 2024
  24. tomberek commented on Aug 13, 2026

    @tomberek
    Contributor

    Closing as stale. Re-open if needed.

  25. moved this from Backlog to Done in Nix UXon Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    UXThe way in which users interact with Nix. Higher level than UI.new-cliRelating to the "nix" commandnix-shellnix-shell, nix develop, nix print-dev-env, etcsignificantNovel ideas, large API changes, notable refactorings, issues with RFC potential, etc.

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions