Skip to content
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

Systematize nix build, nix shell, nix develop, etc (tracking issue) #10504

Open
1 of 11 tasks
roberth opened this issue Apr 15, 2024 · 6 comments
Open
1 of 11 tasks

Systematize nix build, nix shell, nix develop, etc (tracking issue) #10504

roberth opened this issue Apr 15, 2024 · 6 comments
Labels
feature Feature request or proposal good first issue Quick win for first-time contributors new-cli Relating to the "nix" command

Comments

@roberth
Copy link
Member

roberth commented Apr 15, 2024

Is your feature request related to a problem? Please describe.

As discussed in the meeting of 2024-04-15, we propose a new, more systematic naming scheme for these commands, so that they fit into the noun-verb format.
Aliases for the current "short commands" will be kept. The purpose of the scheme is to make it so that by following the aliases, the other, less used functionality becomes more easily discoverable.

Describe the solution

Add plumbing commands, and turn the short commands such as nix run into aliases that point to the right place in this noun-verb command hierarchy:

Rejected 2024-11-27

Evaluate whether the code (also file layout, test layout) can be improved after the renames.

Describe alternatives you've considered

There's a long thread, #4715, but note that it's mostly about one or two command; it rarely discusses a naming system.

Additional context

This is somewhat based on #4715 (comment), but with new insights and team discussion.

Priorities

Add 👍 to issues you find important.

@roberth roberth added feature Feature request or proposal new-cli Relating to the "nix" command labels Apr 15, 2024
@roberth
Copy link
Member Author

roberth commented May 21, 2024

OT: Perhaps nix profile run could be added, to assemble a temporary profile and run a command with it.

Similarly nix profile shell. We'd have to decide whether those transient profiles are mutable. It seems feasible, and we could set something like a NIX_PROFILE environment variable (also used by nix-env; compatible??), so that nested nix profile mutation calls operate on that profile.

@roberth roberth added the good first issue Quick win for first-time contributors label Jun 5, 2024
@BLANKatGITHUB
Copy link

Well , I would like to help in this issue, I am first time contributing here and would appreciate some help.

@roberth
Copy link
Member Author

roberth commented Nov 4, 2024

No "idea approved" label yet

But that doesn't have to be a problem and I did propose this in a meeting, so it's not entirely crazy.
I'm double checking with the team that this proposal is ok. I'm not 100% sure about the package subcommands.

Development setup

A good place to get started is the page about development in the manual. This includes things like building it, and setting up clangd. We're switching to meson for building right around now, so feedback is extra appreciated. That's also why I'm linking URLs to the development version of the URL despite its odd redirect UX.
Make sure you set up a language server. A lot of the effort picking up a new project is reading and navigating, and an LSP helps a lot with the navigating. A lot of what I do is Ctrl+click or Ctrl+Enter to open things, and then I have a custom keybinding for navigating back. git grep or a "global find" feature do the other 30% of navigation.

First change to pick

When you've run a local build, I think you could start with a rename like nix env run, which would be analogous to #10807.
The ones that don't say (rename+alias) tend to be more complicated, but I think we can treat nix env run as a (rename+alias) now.

I would guess that this is not actually a rename and alias in terms of implementation; only UX-wise. This probably involve some refactoring so that we have two commands invoking the same piece of code.

If you're doing something that creates new behaviors that aren't simply aliases, also read up on testing. We do almost all of our CLI testing in tests/functional, but the manual will tell you more about that.

More info about contributing is also in the manual and in CONTRIBUTING.md.

@BLANKatGITHUB
Copy link

So like should I wait till the idea is approved right?
Meanwhile I can read all the docs and familiarise myself with the environment.
I appreciate your help though.

@github-project-automation github-project-automation bot moved this to To triage in Nix team Nov 21, 2024
@roberth roberth removed this from Nix team Nov 27, 2024
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/2024-11-27-nix-team-meeting-minutes-198/56691/1

@BLANKatGITHUB
Copy link

Sorry ,I am kind of busy with my college exams and projects so didnt had much time recently but I would like to start if you okay with it , can you give me an general idea where to start and how.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal good first issue Quick win for first-time contributors new-cli Relating to the "nix" command
Projects
None yet
Development

No branches or pull requests

3 participants