Health checks for your Nix flakes
Go to file
2023-06-21 14:35:05 -07:00
.github/workflows Add clippy to CI 2023-06-21 10:19:21 -07:00
src Add another should-be-clean test case 2023-06-21 14:35:05 -07:00
tests Add another should-be-clean test case 2023-06-21 14:35:05 -07:00
.editorconfig Add editorconfig file 2023-05-19 17:16:52 +02:00
.envrc First commit; provide project basics 2023-05-19 15:36:19 +02:00
.gitignore Add release script 2023-06-14 11:10:00 -07:00
Cargo.lock Add clean and dirty tests 2023-06-21 10:08:25 -07:00
Cargo.toml Remove unnecessary newlines and bump version in Cargo.toml 2023-06-17 14:53:51 -07:00
crane.nix Add Rust and Nix formatting checks 2023-05-26 14:27:27 +02:00
flake.lock flake.lock: Update 2023-06-18 00:26:33 +00:00
flake.nix Add Rust and Nix formatting checks 2023-05-26 14:27:27 +02:00
get-allowed-refs.sh Make allowed refs manual again 2023-05-22 22:16:15 +02:00
LICENSE Add Apache 2.0 license 2023-05-25 17:56:52 +02:00
README.md s/Flake Checker/Nix Flake Checker 2023-06-14 13:38:03 -07:00

Nix Flake Checker

Nix Flake Checker is a tool from Determinate Systems that performs "health" checks on the flake.lock files in your flake-powered Nix projects. Its goal is to help your Nix projects stay on recent and supported versions of Nixpkgs.

To run the checker in the root of a Nix project:

nix run github:DeterminateSystems/flake-checker

# Or point to an explicit path for flake.lock
nix run github:DeterminateSystems/flake-checker /path/to/flake.lock

Nix Flake Checker looks at your flake.lock's root-level Nixpkgs inputs and checks that:

  • Any explicit Nixpkgs Git refs are in this list:
    • nixos-22.11
    • nixos-22.11-small
    • nixos-23.05
    • nixos-23.05-small
    • nixos-unstable
    • nixos-unstable-small
    • nixpkgs-22.11-darwin
    • nixpkgs-23.05-darwin
    • nixpkgs-unstable
  • Any Nixpkgs dependencies are less than 30 days old
  • Any Nixpkgs dependencies are have the NixOS org as the GitHub owner (and thus that the dependency isn't a fork or non-upstream variant)

If you're running it locally, Nix Flake Checker reports any issues via text output in your terminal. But you can also use Nix Flake Checker in CI.

The Nix Flake Checker Action

You can automate Nix Flake Checker by adding Determinate Systems' Nix Flake Checker Action to your GitHub Actions workflows:

checks:
  steps:
    - uses: actions/checkout@v3
    - name: Check Nix flake Nixpkgs inputs
      uses: DeterminateSystems/flake-checker-action@main

When run in GitHub Actions, Nix Flake Checker always exits with a status code of 0 by default—and thus never fails your workflows—and reports its findings as a Markdown summary.

Telemetry

The goal of Nix Flake Checker is to help teams stay on recent and supported versions of Nixpkgs. The flake checker collects a little bit of telemetry information to help us make that true.

Here is a table of the telemetry data we collect:

Field Use
distinct_id An opaque string that represents your project, by sha256 hashing repository and organization details.
version The version of Nix Flake Checker.
is_ci Whether the checker is being used in CI (GitHub Actions).
disallowed The number of inputs using unsupported branches of Nixpkgs.
outdated The number of inputs using outdated versions of Nixpkgs.
non_upstream The number of inputs using forks of Nixpkgs.

To disable diagnostic reporting, set the diagnostics URL to an empty string by passing --no-telemetry or setting FLAKE_CHECKER_NO_TELEMETRY=true.

You can read the full privacy policy for Determinate Systems, the creators of this tool and the Determinate Nix Installer, here.