A command-line tool that explains why two Nix derivations differ, helping debug cache misses and verify changes.
nix-diff is a command-line tool that compares two Nix derivations and explains why they differ. It helps Nix users understand how changes to their Nix expressions affect the resulting build artifacts, making it easier to debug cache misses and verify that modifications have the intended effect. The tool outputs a detailed, human-readable diff showing exactly what changed between derivations.
Nix users and developers who need to understand why their Nix builds behave differently after changes, particularly those working with complex Nix expressions or debugging cache issues.
nix-diff provides unique insight into Nix's derivation system that isn't available through standard Nix tools, offering a specialized diff view that helps users understand the exact impact of their changes at the derivation level.
Explain why two Nix derivations differ
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Outputs human-readable differences between Nix derivations, including changes to inputs, environment variables, and build parameters, as shown in the NixOS example where adding a service alters the system derivation.
Specifically helps identify why Nix builds miss the binary cache by revealing exact derivation changes that trigger rebuilds, addressing a common pain point for Nix users.
Accepts various input types like derivation files, store paths, or symbolic links, allowing comparisons from different stages of the Nix build process, as demonstrated with nix-instantiate outputs and result symlinks.
Generates color-coded diff output that highlights changes clearly, improving readability over raw Nix data and making it easier to spot differences at a glance.
The author explicitly states no plans to add new features in the README, which may limit the tool's adaptation to future Nix ecosystem changes or user-requested enhancements.
Requires Nix to be installed and properly configured, as noted in the testing section, adding overhead for users not already embedded in the Nix environment or those seeking standalone tools.
Lacks graphical or web-based interfaces, relying solely on command-line output, which could be less accessible for users who prefer more interactive or visual diff experiences.