Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Flake templates #188
base: master
Are you sure you want to change the base?
Flake templates #188
Changes from all commits
d9c6784
3e1aac9
738c32e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It looks like there is a tendency to not use
flake-utils
in the new projects (either by replacing it withflake-parts
or its manually written equivalent), so I guess it would be better to do the same here.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.
For a dev shell, wouldnt it be useful to also include rust-analyzer and rust-src?
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.
Unsure on this one. How useful this would be to users depends on how they have their IDE and system configured. On NixOS this might make more sense. For users on other distributions which use Nix for a specific project, they may have their language servers installed globally (e.g. system package manager,
rustup
) or by their editor (e.g. VSCode extensions, mason.nvim) which may not pickup an LS in the local environment. Worth including in further discussions about what templates for rust-overlay should be/include.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.
That's fair, though I'm not sure what the point of a rust devShell would be if rust is already installed globally.
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.
Many people prefer using/creating dev shells for open source stuff to lower the barrier of entry to hacking on the project, by removing the need to globally install tools and preventing the dreaded "It works on my machine" problem. They also help ensure the same (versions of) tools are used in development, CI and packaging. Dev shells are still useful for personal projects for these reasons, but their true potential shines when used by multiple people or across many machines.
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.
I know what the point of a devShell is 😅 My point was that a devShell isn't needed if rust is already installed globally, especially with rust having almost perfect backwards compatibility (even more so on stable releases as is the case here). This is also a devShell, it doesn't build a package or anything.
I'd agree with you if this was a non-trivial devShell that includes dependencies (eg. pkg-config, openssl, some specific dev tooling, a specific version of the rust toolchain), but this is just a template where people can build upon. People can remove the extensions they don't need after creating it, and it also serves as an example.
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.
No they wouldn't. Most of people will copy code from internet, check if it compiles(evals), and then keep it forever without a second glance. ChatGPT hype and sshd-depends-on-systemd (JiaTan's supply chain attack) all taught us that. I'm against making a "template" too big and/or too complete.
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.
Wouldn't it be better to use:
?
This would lead to result more consistent with non-Nix users (i.e., there would be the single source of truth about toolchain) and also solve the problem of easier configuring additional components (which are also specifyable in
rust-toolchain.toml
)