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

Nix/Nixos development #6947

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Nix/Nixos development #6947

wants to merge 3 commits into from

Conversation

RenjiSann
Copy link
Contributor

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

$ direnv allow

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.

@sylvestre
Copy link
Contributor

I am not a fan of adding specific configuration for each distros :/

@RenjiSann
Copy link
Contributor Author

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 build-gnu.sh, while being necessary to NixOS, is not specifically breaking anything for the others.

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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link

github-actions bot commented Jan 2, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants