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

Noise Explorer command-line tool #1

Merged
merged 5 commits into from
Sep 7, 2021
Merged

Noise Explorer command-line tool #1

merged 5 commits into from
Sep 7, 2021

Conversation

raghuramlavan
Copy link
Collaborator

The flake for Noise Explorer command-line tool. It needs noise pattern files from Noise Explorer Repository. The tool needs rust and go for building and has been included in the development environment.

echo -n "[NoiseExplorer] Generating NoiseParser..."
echo "Parser Generated"
cd util
node --version

Choose a reason for hiding this comment

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

probably don't need that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes. Removed

flake.nix Outdated Show resolved Hide resolved

# Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "nixpkgs/nixos-20.09";
inputs = {

Choose a reason for hiding this comment

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

don't you also need the source of the noise explorer as well ?
Perhaps you have it locally, but I don't think it's available to everybody.
Perhaps that explains why you needed to cd src further down.

Copy link
Member

Choose a reason for hiding this comment

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

It's fetched via fetchgit in default.nix which seems fine.
But I agree, handling the source as a flake input will allow the user to change the source version via flakes interface (nix flake lock --update-input will be possible for example). That can be convenient, especially when this flake is used by other flakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is fetched in default.nix and try to use the same version in the flake.nix and also in default.nix

Choose a reason for hiding this comment

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

Would you mind putting the src in the inputs ?
It's a little clearer that way, it also provides a convenient update mechanism.

Copy link
Member

@DavHau DavHau left a comment

Choose a reason for hiding this comment

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

In the default.nix there seem to be many print statements. Probably leftovers form debugging. Maybe you can have another look and remove unnecessary things.

Usually phases announce themselves already. There is probably no need to have things like echo "Build Phase Over...."

Exposing the source as flake input can make usage more convenient as mentioned in the other comment.

Apart from that it looks good to me.


# Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "nixpkgs/nixos-20.09";
inputs = {
Copy link
Member

Choose a reason for hiding this comment

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

It's fetched via fetchgit in default.nix which seems fine.
But I agree, handling the source as a flake input will allow the user to change the source version via flakes interface (nix flake lock --update-input will be possible for example). That can be convenient, especially when this flake is used by other flakes.

flake.nix Outdated Show resolved Hide resolved
@raghuramlavan
Copy link
Collaborator Author

I have made two more commits implementing the changes.

@DavHau
Copy link
Member

DavHau commented Aug 17, 2021

Is it a good idea to reformat auto generated code with nixpkgs-fmt? Each time you re-run node2nix it will destroy the format again.

One more thing I noticed. There is no meta attribute set for the derivation in default.nix.
Example for meta:
https://github.com/ngi-nix/project-template/blob/646d963aa4817a570a0229238015abf566face7c/flake.nix#L45-L48

@happysalada
Copy link

happysalada commented Aug 17, 2021

Right on topic for NixOS/rfcs#101
Running nixpkgs-fmt after the tool doesn't seem that bad.
Perhaps in an update script, run the formatter after the generated code.
I understand that is debatable. No strong feelings either way.

@andir
Copy link

andir commented Aug 17, 2021

Right on topic for NixOS/rfcs#101
Running nixpkgs-fmt after the tool doesn't seem that bad.
Perhaps in an update script, run the formatter after the generated code.
I understand that is debatable. No strong feelings either way.

That only makes sense if the entire project agrees and is setup in such a way that unformatted Nix is rejected by CI, formatting is enforced with editor/pre-commit configuration etc.

If you can't enforce it then it will diverge over time over and over again.

@happysalada
Copy link

We should definitely try adding a github action to enforce this check, as an experiment.
Regarding the upstream project, the maintainer has been unresponsive so far, so there is a good chance this never gets upstreamed and the person packaging can experiment with what they like best.
Thank you for dropping by and taking the time to comment!

default.nix Outdated Show resolved Hide resolved
shell.nix Outdated Show resolved Hide resolved
@raghuramlavan
Copy link
Collaborator Author

@cdepillabout Planning to finalise this. Should i add "ready for review flag"

@cdepillabout
Copy link

@raghuramlavan When you're happy with this, please merge it in and send a message on ngi-nix/ngi#40.

@raghuramlavan raghuramlavan merged commit 3b372b8 into ngi-nix:master Sep 7, 2021
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.

5 participants