Gabriella439 / nix-diff

Explain why two Nix derivations differ
BSD 3-Clause "New" or "Revised" License
340 stars 18 forks source link

Replacing a file in the system closure with a local file breaks nix-diff #44

Closed dasJ closed 2 years ago

dasJ commented 2 years ago

Evaluating a system, adding the code below, and diffing the two breaks nix-diff:

{
  system.extraSystemBuilderCmds = ''
    rm $out/bin/switch-to-configuration
    substituteAll ${./switch-to-configuration.pl} $out/bin/switch-to-configuration
    chmod +x $out/bin/switch-to-configuration
  '';
}

Just get any switch-to-configuration.pl and place it next to this example module. This does not happen when you just remove the file and touch a new one, it has to be a local path that is used there. This does also not happen when you just add a new file into the system closure, only when you replace an existing one.

- /nix/store/70g75hvzqpabyi01i4w8466pb6frczkl-nixos-system-acerola-21.05.drv:{out}
+ /nix/store/xv3lp3wf5f6b4ylssqbmyq8763ls5240-nixos-system-acerola-21.05.drv:{out}
nix-diff: src/Main.hs:(554,9)-(569,25): Non-exhaustive patterns in case