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

setup: add nix flake #406

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

Conversation

Yohh
Copy link

@Yohh Yohh commented Mar 5, 2025

Description

nix package manager users can setup a shell environnement based on a flake.nix file that describes tools and versions needed to dev and run the project, this flake contains:

  • nodejs 20
  • npm
  • typescript language server
  • angular language service

nix flakes combinated with direnv allow to open a project folder with automatic setup launch, creates en .envrc file and a .direnv directory. -> not every contributors use it and want to have those dotfiles, so it should be ignored by git.

Issues

Checklist

  • This PR contains a description of the changes I'm making
  • I've read the Contribution Guidelines
  • I've added tests for changes or features I've introduced
  • I documented any high-level concepts I'm introducing in documentation/
  • CI is currently green and this is ready for review

nix package manager users can setup a shell environnement based on a
flake.nix file that describes tools and versions needed to dev and run
the project, this flake contains:
- nodejs 20
- npm
- typescript language server
- angular language service

nix flakes combinated with direnv allow to open a project folder with
automatic setup launch, creates en .envrc file and a .direnv directory.
-> not every contributors use it and want to have those dotfiles, so it
should be ignored by git.

Co-authored-by: Uriel-Sautron <[email protected]>
@Yohh Yohh requested a review from aiAdrian as a code owner March 5, 2025 15:15
@aiAdrian aiAdrian requested a review from louisgreiner March 6, 2025 10:06
@aiAdrian
Copy link
Collaborator

aiAdrian commented Mar 6, 2025

@louisgreiner I don't understand the changes. Does this change have any impact on the current application with respect to local installation, integration, etc., or does it only enable a new way to work with the Netzgrafik-Editor in terms of developing tools?

@Yohh
Copy link
Author

Yohh commented Mar 6, 2025

@louisgreiner I don't understand the changes. Does this change have any impact on the current application with respect to local installation, integration, etc., or does it only enable a new way to work with the Netzgrafik-Editor in terms of developing tools?

it has no impact on anyone who doesn't use nix package manager, but it allows nix users to setup quickly and sustainably the tools to work on NGE, at the good version, with no need to manually switch between tool versions from a project to another.

a lot of OSRD developpers use nix, that's why I propose this addition

@louisgreiner
Copy link
Collaborator

As @Yohh mentionned, Nix won't impact the current state of NGE (as for the development, the integration or the usability of the application). It only provides a new way to very quickly setup the project for developers.

For instance, NGE uses a specific version of NPM (and other packages), however, another project can use different versions for these packages : it can be boring for the developer to switch from a version to another all day.

When projects get bigger, it become especially important to have these tools, to support the developers' setups. (I also, i.e., use Nix for OSRD)

In conclusion: it won't impact NGE, nor the use we have from a developer point of view, but neither the stability of the application

Copy link
Collaborator

@louisgreiner louisgreiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to write some documentation on how to use the flake ? Or at least a link to redirect to Nix setup ?

Otherwise nice feature, I'm gonna test it soon

@Yohh
Copy link
Author

Yohh commented Mar 6, 2025

Would it be possible to write some documentation on how to use the flake ? Or at least a link to redirect to Nix setup ?

Otherwise nice feature, I'm gonna test it soon

done for documentation

my linter has cleaned some extra-lines, tell me if you want me to erase those changes

@Yohh Yohh requested a review from louisgreiner March 6, 2025 15:05
Copy link
Collaborator

@louisgreiner louisgreiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, it works very well 🎉 We can hope it will allow more people to contribute to NGE

image

@Yohh Yohh mentioned this pull request Mar 7, 2025
2 tasks
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.

3 participants