Add a Nix flake with a devshell, and package builds #266
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves https://github.com/blockfrost/blockfrost-ops/issues/2023
Devshell
I have added a direnv devshell. With just
nixanddirenvonPATH, you just enter the project directory, and are welcome with this message:You don’t need to have proper versions of Cargo, Rust,
rust-analyzeretc. installed globally, they will be available in the devshell. Some editors can also pick it up and JustWork™ (e.g. Emacs).Package definitions
You can build the packages for all systems, by running:
ci.iog.io
If accepted, I would ask the Core SRE to enable the IOG CI for this repository (including the checks below).
Some broken checks
A few checks are returning errors:
cargo clippy(run withnix build -L .#checks.x86_64-linux.cargo-clippy) – 86 errorscargo-deny(run withnix build -L .#checks.x86_64-linux.cargo-deny) – 632 errorsFixing them will be a large diff, so it's best to do in a separate PR.
Related:
Source auto-formatting
I have commented out certain
treefmtformatters—leaving only the one for*.nixfiles:prettierfor*.jsonand*.ts,rustfmt,yamlfmt,taplofor*.toml,shfmtfor Bash scripts,because running them all (
nix fmtortreefmt) results in a very large diff:There are various benefits to auto-formatting, but if you decide to do this, it's best to do auto-formatting in a separate PR.
Windows build
It’s broken (see this Slack thread), because
caryatid_processdoesuse tokio::signal::unix, which is not available on Windows. You can try it with the following command on Linux:Logged as: