Skip to content

Diff tool integration? #356

@l0b0

Description

@l0b0

When running deploy with a bunch of hosts it would be useful to see details of what changed. This could be done manually by doing something like this:

  1. SSH into each host and readlink --canonicalize /nix/var/nix/profiles/system to get the current system state.
  2. Run deploy.
  3. SSH into each host again and diff the new system path to the original.

But this is cumbersome:

  • It reports the diff after deploy, rather than integrated with the rest of the host-specific deploy-rs output.
  • It requires inspecting nixosConfigurations to get the hostname.
  • It doesn't integrate with deploy-rs's --ssh-user, --hostname, etc.

It would be great if deploy-rs integrated seamlessly with existing diffing tools like nix store diff-closures and/or nvd (like bento does).

Bike-shedding:

  • Should this be enabled or disabled by default? I must confess I would like this to be enabled by default, since deploy-rs already prints some information about which services changed state, and since the diff is the second most important piece of information after any error messages.
  • Should it use high-level tools like nvd if they exist, and fall back to nix store diff-closures if they don't, or should the user have to explicitly specify the tool? Automatic fallback is simpler to use, but harder to implement. Manual configuration is harder to use, but easier to implement with something like --diff-tool=CMD.

Complexities:

  • In case of --boot or --result-path, deploy-rs should do the expected thing and diff the original system path to the newly created path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions