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

Add Nix flake to biscuit-cli #56

Merged
merged 2 commits into from
Mar 30, 2024
Merged

Conversation

er4hn
Copy link
Contributor

@er4hn er4hn commented Mar 16, 2024

Add a Nix flake to biscuit-cli so it's easier to make use of nix develop and nix shell when playing with biscuits.

I tested that the biscuit program works when running nix shell. I tested that cargo run, cargo test (there are no tests?), cargo fmt --check, and cargo clippy all work in nix develop.

Really like the project and I find nix flakes make it easier to pull something down and play with it without doing too much installation.

@divarvel
Copy link
Collaborator

There are no rust tests (the CLI exposes the library directly), only e2e tests using bats

Copy link

@ptitfred ptitfred left a comment

Choose a reason for hiding this comment

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

I'll let @divarvel give the final approval as I'm merely an educated observer of this repository

Comment on lines +25 to +33
nativeBuildInputs = with pkgs; [
cargo
clippy
libiconv
rustc
rustfmt
rust-analyzer
];
};

Choose a reason for hiding this comment

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

Shouldn't we have the same shell in both the flake and the classic shell.nix?

Note that one can pkgs.callPackage ./shell.nix in here if needed.

Choose a reason for hiding this comment

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

This question might more to the core contributors than yourself @er4hn :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

i don't really use the shell.nix anymore, feel free to harmonize as needed.

inherit system;
};

naersk' = pkgs.callPackage naersk {};

Choose a reason for hiding this comment

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

Have you considered using the overlay provided by naersk directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is that? I'm not super familiar with Nix and used the naersk template suggested by their github repo.

Choose a reason for hiding this comment

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

Overlays are a way to override packages definition (in a lazy recursive manner) but in that case they don't bring much. It would have let you extend the pkgs to include ones provided by naersk and have it available with pkgs.naersk.

In this case it doesn't matter and it's totally fine to stick to the official example.

flake.nix Outdated Show resolved Hide resolved
@divarvel
Copy link
Collaborator

divarvel commented Mar 19, 2024

thanks for the contribution! i'll let you address (or not) the points raised by @ptitfred and i'll merge

@ptitfred
Copy link

Nothing is mandatory

@er4hn
Copy link
Contributor Author

er4hn commented Mar 20, 2024

Thank you. I updated to remove the un-needed parenthesis. If it is fine with everyone else I will skip the other suggested changes.

@er4hn
Copy link
Contributor Author

er4hn commented Mar 30, 2024

Gentle nudge, it looks like the workflow needs to be triggered by a maintainer to accept this.

@divarvel
Copy link
Collaborator

Ah right, sorry.

@divarvel divarvel merged commit 4577fe4 into biscuit-auth:main Mar 30, 2024
1 check passed
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