Nix/NixOS package version diff tool
Find a file
2024-05-04 18:47:30 -07:00
src Highlight the changed parts of version numbers (issue #17). 2024-05-04 18:47:30 -07:00
.gitignore Docs, packaging, licensing. 2021-04-09 21:05:12 -07:00
CHANGELOG.md Highlight the changed parts of version numbers (issue #17). 2024-05-04 18:47:30 -07:00
default.nix Bump to v0.2.4. 2023-05-22 11:47:24 -07:00
flake.nix Remove URL literal 2022-05-23 16:47:16 +00:00
LICENSE Add a LICENSE file with the Apache 2.0 license text. 2021-04-10 18:44:27 -07:00
README.md Add a note that nvd should be obtained through Nixpkgs. 2022-10-12 18:26:24 -07:00

nvd - Nix/NixOS package version diff tool

nvd is a tool for diffing the versions of all store paths in the closures of two Nix store paths, neatly summarizing the differences. This is mainly intended for comparing two system configurations and is inspired by the output of emerge -pv from Gentoo's Portage package manager. nvd could also be likened to the output of Debian's apt upgrade -V, or any equivalent from other distributions' package managers. nvd isn't limited to comparing system configurations though, and can work with any two store paths.

I wrote nvd as a way to see what is changing on my systems when I run nixos-rebuild. Package rebuilds usually aren't important to me, but I need to know when versions change. Usually I care most about packages that are included in environment.systemPackages, so packages in this list are highlighted and coloured specially and changes to this list are reported.

The recommended way to obtain nvd is through Nixpkgs, where it has the attribute name nvd.

I recommend wrapping your usual nixos-rebuild call in a script that compares the result to the current system:

nixos-rebuild build "$@" && nvd diff /run/current-system result

Here is an example session. We can see that Nixpkgs updates have been pulled in, bringing in various package updates. Firefox and cpupower have been installed explicitly in systemPackages, and bpytop has been newly added to the list:

$ nvd diff /nix/var/nix/profiles/system-{14,15}-link
<<< /nix/var/nix/profiles/system-14-link
>>> /nix/var/nix/profiles/system-15-link
Version changes:
[U*]  #1  cpupower                5.4.87 -> 5.4.88
[U*]  #2  firefox                 84.0.1 -> 84.0.2
[U.]  #3  firefox-unwrapped       84.0.1 -> 84.0.2
[U.]  #4  initrd-linux            5.4.87 -> 5.4.88
[U.]  #5  linux                   5.4.87 -> 5.4.88
[U.]  #6  nixos-system-unnamed    20.09.git.6ad5c94ed93 -> 20.09.git.9bf1626e7bb
[U.]  #7  system76-acpi-module    1.0.1-5.4.87 -> 1.0.1-5.4.88
[U.]  #8  system76-io-module      1.0.1-5.4.87 -> 1.0.1-5.4.88
[U.]  #9  x86_energy_perf_policy  5.4.87 -> 5.4.88
Added packages:
[A+]  #1  bpytop  1.0.50
Closure size: 2205 -> 2206 (38 paths added, 37 paths removed, delta +1).

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.