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

dev: add nix flake environment #5297

Merged
merged 2 commits into from
Oct 19, 2023
Merged

dev: add nix flake environment #5297

merged 2 commits into from
Oct 19, 2023

Conversation

ElysaSrc
Copy link
Member

I've added a flake-ified version of https://github.com/flomonster/osrd-nix-config.
You can fire up a dev shell by using nix develop. (You might need to enable experimental flags on nix to use flakes).

This is still a work in progress, here are some elements that should be discussed:

  • I've put the packages files in a nix/ folder.
  • I've used alejandra for linting nix files.
  • It provides the scripts in the scripts/ folder as commands that can be directly called with their names (./script/generate-infra.sh will be generate-infra directly in the dropped shell).

@ElysaSrc ElysaSrc requested a review from flomonster October 11, 2023 21:51
@ElysaSrc ElysaSrc changed the title draft: dev: add nix flake environement dev: add nix flake environment Oct 12, 2023
@ElysaSrc ElysaSrc marked this pull request as draft October 12, 2023 07:33
@ElysaSrc ElysaSrc marked this pull request as ready for review October 12, 2023 08:55
flake.nix Outdated Show resolved Hide resolved
flake.nix Show resolved Hide resolved
@ElysaSrc ElysaSrc force-pushed the ev/nix-all-the-things branch 2 times, most recently from bd4d85c to ed1c091 Compare October 12, 2023 10:17
Copy link
Contributor

@flomonster flomonster left a comment

Choose a reason for hiding this comment

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

I'm not a Nix expert but it seems to work fine 👌
I just spotted the loss of autocompletion for the cargo commands.

flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
@ElysaSrc ElysaSrc force-pushed the ev/nix-all-the-things branch from ed1c091 to c7cb556 Compare October 18, 2023 16:15
@ElysaSrc ElysaSrc requested review from flomonster and multun October 18, 2023 16:15
@ElysaSrc
Copy link
Member Author

I'm not a Nix expert but it seems to work fine 👌 I just spotted the loss of autocompletion for the cargo commands.

For the autocompletion on cargo commands, I'm searching but I'm not quite sure why it's doing this.

I've taken into account your suggesstions, just changed the nodePackages with a version that ensure the same nodejs version is used accross all "globally" installed packages.

@ElysaSrc ElysaSrc force-pushed the ev/nix-all-the-things branch from c7cb556 to 2f96ac0 Compare October 19, 2023 20:07
- Implement flakes with development dependencies
- Add a `shell.nix` that leverages edolstra/flake-compat
@ElysaSrc ElysaSrc force-pushed the ev/nix-all-the-things branch from 2f96ac0 to 9aebedc Compare October 19, 2023 20:08
@ElysaSrc
Copy link
Member Author

The only changes, since the validation of @multun, is the addition of a shell.nix that leverages https://github.com/edolstra/flake-compat (edolstra is the creator of nix).
This allows extensions like https://marketplace.visualstudio.com/items?itemName=arrterian.nix-env-selector for vscode to leverages the devShell dropped by the flake.

It simply is a retrocompatibility layer.

@ElysaSrc ElysaSrc enabled auto-merge October 19, 2023 20:26
@ElysaSrc ElysaSrc added this pull request to the merge queue Oct 19, 2023
Merged via the queue into dev with commit 2b143c6 Oct 19, 2023
@ElysaSrc ElysaSrc deleted the ev/nix-all-the-things branch October 19, 2023 20:30
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