No description
Find a file
Marcel Müller e9732eb1ec Passthru lints
Signed-off-by: Marcel Müller <neikos@neikos.email>
2025-03-04 15:02:53 +01:00
dylint_driver Get a half working example working 2025-03-03 15:30:17 +01:00
lib Passthru lints 2025-03-04 15:02:53 +01:00
tests/example_lint_target Get a half working example working 2025-03-03 15:30:17 +01:00
.envrc Initial Commit 2025-03-03 09:55:12 +01:00
.gitignore Get a half working example working 2025-03-03 15:30:17 +01:00
flake.lock Add initial layout 2025-03-03 10:08:09 +01:00
flake.nix Don't put a system to mkLib 2025-03-04 11:37:23 +01:00
LICENSE-APACHE-2.0 Add Licenses 2025-03-04 10:06:02 +01:00
LICENSE-MIT Add Licenses 2025-03-04 10:06:02 +01:00
mk-lib.nix Use mkLib pattern 2025-03-04 10:53:57 +01:00
README.md Add crane as prereq 2025-03-04 11:17:27 +01:00

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 nixpkgs instance with the rust-overlay applied from oxalica/rust-overlay.
  • crane from ipetkov/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.