-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Nix/Nixos development #6947
base: main
Are you sure you want to change the base?
Nix/Nixos development #6947
Conversation
I am not a fan of adding specific configuration for each distros :/ |
Well most of the patch only eases Nix integration (not NixOS), which aside of being a package manager, also serves as a development environment manager with flakes (so exactly that kind of use case) Also, the patch of I understand that is a kind of arbitrary addition to the repository, but I think providing a simple way to build the project for newcomers and potential contributors is in our interest, even if it is something else than nix flakes |
@@ -0,0 +1,5 @@ | |||
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then |
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 don't like the hardcoded versions here?
is there a better way?
or can we just land flake.nix ?
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.
To explain what's going on, direnv naturally supports the use flake
directive. However, with the default implementation, we are doomed to re-computing the flake each time we get in/out of the directory.
This line allows to use an implementation that is made by the nix community and which caches the flake's build.
As for the version check, I guess we could remove it. I'm not very familiar with the previous versions, so I don't really know what this will imply.
GNU testsuite comparison:
|
I don't really know if this has its place here, but I've been using a nix flake to setup my dev environment for a while, and I thought I might share it here, and maybe integrate it to the main branch if it's coherent.
To make use of these scripts, you'll first need to install the Nix package manager (instructions)
Then, install the
direnv
package from your preferred distro (instructions)Once that's done, open a shell and type
in the repository. The initial setup will take 1-2min.
After that, your environment will be instantly loaded every time you
cd
to this folder !I note that for rust-analyzer to work in VS Code, I installed the
direnv
extension, which allows VS Code to load the.envrc
.