|
|
||
|---|---|---|
| dylint_driver | ||
| lib | ||
| tests/example_lint_target | ||
| .envrc | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE-APACHE-2.0 | ||
| LICENSE-MIT | ||
| mk-lib.nix | ||
| README.md | ||
Dylint as a nix library
This repository contains a nix library that allows easy access to the dylint project in a reproducible way.
Current State
⚠️⚠️⚠️ This repo is still evolving, and as such might break your evaluation on update. Input to the design and structure are welcome! ⚠️⚠️⚠️
How to use
Dylint has some great documentation on how Dylint itself works.
This library then compiles and assembles the different parts you need to get it working inside nix.
Prerequisites
Using nix-dylint requires the following:
- A
nixpkgsinstance with therust-overlayapplied fromoxalica/rust-overlay. cranefromipetkov/crane- A list of lints and their nightly toolchains, formatted as e.g.
nightly-{date}
Building a dylint instance
Dylint tries its best to do everything for you, but this clashes with the way
nix-users generally use their software. So this library generates a
cargo-dylint wrapper with the relevant env variables set such that it should
not build anything.
Assembling it all, it might look like this:
dylintLib = inputs.nix-dylint.mkLib { inherit pkgs crane; };
dylint = dylintLib.mkDylint { lints = [
{
toolchain = "nightly-2025-01-09";
package = dylintLib.cargo-dylint-general;
}
]; }
dylint is then a derivation that provides the cargo-dylint executable. One
can then use it as usual.