A tool to detect and report duplicate dependencies in Nix flakes.
Nix flakes use a lock file (flake.lock) to pin dependencies to specific versions, ensuring reproducible builds.
However, when multiple flakes in your dependency tree depend on the same upstream flake (like nixpkgs or flake-utils),
they might reference different versions of it.
This creates several issues:
Increased Closure Size: Each version of a dependency must be downloaded and stored separately, significantly increasing disk usage and download times.
Evaluation Performance: Nix has to evaluate multiple versions of the same flake, slowing down your build times and nix flake commands.
Inconsistent Behavior: Different parts of your project might use different versions of the same packages, leading to subtle bugs and version conflicts.
This commonly occurs when:
flake.lock updatesflake-utils, nixpkgs, etc.)flake-linter scans your flake.lock file and identifies all cases where the same dependency appears multiple times with different versions,
helping you spot these issues before they impact your project.
$ cd your-flake-project
$ nix run github:Mic92/flake-linter
github:numtide/flake-utils has multiple versions:
flake-utils is used by: crane, pre-commit-hooks-nix, root, rust-overlay
flake-utils_2 is used by: lanzaboote
# Run on a specific flake.lock file
$ flake-linter /path/to/flake.lock
# Show all dependencies (including single versions)
$ flake-linter --verbose
# Exit with error code if duplicates are found (useful for CI)
$ flake-linter --fail-if-multiple-versions
Run directly with Nix:
nix run github:Mic92/flake-linter
Or add to your flake inputs for regular use:
{
inputs.flake-linter.url = "github:Mic92/flake-linter";
}
nix flake update to try getting your dependencies on the same versionsinputs.some-flake.inputs.nixpkgs.follows = "nixpkgs";
MIT
822 followers · starred Jan 2024
739 followers · starred Oct 2024
159 followers · starred Nov 2025
131 followers · starred Jan 2024
A tool to detect and report duplicate dependencies in Nix flakes.
Nix flakes use a lock file (flake.lock) to pin dependencies to specific versions, ensuring reproducible builds.
However, when multiple flakes in your dependency tree depend on the same upstream flake (like nixpkgs or flake-utils),
they might reference different versions of it.
This creates several issues:
Increased Closure Size: Each version of a dependency must be downloaded and stored separately, significantly increasing disk usage and download times.
Evaluation Performance: Nix has to evaluate multiple versions of the same flake, slowing down your build times and nix flake commands.
Inconsistent Behavior: Different parts of your project might use different versions of the same packages, leading to subtle bugs and version conflicts.
This commonly occurs when:
flake.lock updatesflake-utils, nixpkgs, etc.)flake-linter scans your flake.lock file and identifies all cases where the same dependency appears multiple times with different versions,
helping you spot these issues before they impact your project.
$ cd your-flake-project
$ nix run github:Mic92/flake-linter
github:numtide/flake-utils has multiple versions:
flake-utils is used by: crane, pre-commit-hooks-nix, root, rust-overlay
flake-utils_2 is used by: lanzaboote
# Run on a specific flake.lock file
$ flake-linter /path/to/flake.lock
# Show all dependencies (including single versions)
$ flake-linter --verbose
# Exit with error code if duplicates are found (useful for CI)
$ flake-linter --fail-if-multiple-versions
Run directly with Nix:
nix run github:Mic92/flake-linter
Or add to your flake inputs for regular use:
{
inputs.flake-linter.url = "github:Mic92/flake-linter";
}
nix flake update to try getting your dependencies on the same versionsinputs.some-flake.inputs.nixpkgs.follows = "nixpkgs";
MIT
822 followers · starred Jan 2024
739 followers · starred Oct 2024
159 followers · starred Nov 2025
131 followers · starred Jan 2024