Skip to content

faukah/dix

Repository files navigation

Diff Nix

A blazingly fast tool to diff Nix related things.

Currently only supports closures (a derivation graph, such as a system build or package).

output of dix /nix/var/nix/profiles/system-69-link/ /run/current-system

Usage

$ dix --help

Diff Nix

Usage: dix [OPTIONS] <OLD_PATH> <NEW_PATH>

Arguments:
  <OLD_PATH>

  <NEW_PATH>

Options:
  -v, --verbose...
          Increase logging verbosity

  -q, --quiet...
          Decrease logging verbosity

      --color <WHEN>
          Controls when to use color

          [default: auto]
          [possible values: auto, always, never]

      --force-correctness
          Fall back to a backend that is focused solely on absolutely guaranteeing correct results at the cost of memory usage and query speed.

          This is relevant if the output of dix is to be used for more critical applications and not just as human-readable overview.

          In the vast, vast majority of cases, the default backend should be sufficient.

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

$ dix /nix/var/profiles/system-69-link /run/current-system

Usage in CI

If you're planning on using dix in CI, you might want to set the --force-correctness flag to ensure that the results are definitely accurate.
Dix will fall back to a connection using ?immutable=1 to Nix's SQLite database if it fails connecting normally; This can however result in inaccurate output if the database is being written to at the same time.
Passing --force-correctness will make dix fall back to Nix commands if connection to the database fails, which ensures correct output, potentially at the cost of speed.

Contributing

If you have any problems, feature requests or want to contribute code or want to provide input in some other way, feel free to create an issue or a pull request!

Thanks

Huge thanks to nvd for the original idea! Dix is heavily inspired by this and basically just a "Rewrite it in Rust" version of nvd, with a few things like version diffing done better.

Furthermore, many thanks to the amazing people who made this projects possible by contributing code and offering advice:

  • @Dragyx - Cool SQL queries. Much of dix's speed is thanks to him.
  • @NotAShelf - Implementing proper error handling.
  • @RGBCube - Giving the codebase a deep scrub.

License

Dix is licensed under GPLv3. See the license file for more details.

About

Diff Nix

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5