It turns out that evaluation the Nix option restrict-eval is enabled for builds in NURs, that’s why the nvd build worked locally, but failed when I uploaded the change to NUR. I guess we have to wait for the nixpkgs pull request.
@ony are you using a new version of nix? nix 2.3.10 does not have a store command (at least I cannot find it).
I didn’t know of the nix command when I built nvd (plus Nix’s command was only in Nix unstable then, not sure if that’s changed now). They’re separate, but they do largely the same thing, and present their results differently. Nix’s built-in command is nice for showing disk size changes and for having a threshold for showing a package purely based on that. Nix’s command only shows versions that changed, when there are multiple for a package, whereas nvd will always show you all versions for a package. And I’m not sure Nix’s command has any support for highlighting systemPackages.
I’m not sure if you’re asking about diffing the .drv files in the Nix store, or perhaps you mean the expressions in the .nix files coming from Nixpkgs? As mentioned higher up in the thread, nix-diff and nvd can both handle derivations. The output of both can be quite noisy, but nix-diff will show the complete set of changes. If you’re just wanting to diff the expressions, you’ll have to run a diff between versions of Nixpkgs, e.g.:
.drv files can’t be traced back to the .nix files they were built from, so there’s no easy way for a tool like nvd to show “here’s this upgrade and here are the changes to the expression.”
I have this in my rebuild script to see the diff: ls -v1 /nix/var/nix/profiles | tail -n 2 | awk '{print "/nix/var/nix/profiles/" $0}' - | xargs nvd diff
Through the power of the alphabetic order, this gives me the cumulative changes between the booted and current system generations. I don’t always reboot for every upgrade, and I use this to (among other things) see if the kernel has changed.
That’s clever, picking up booted-system before current-system. If you’re creating new generations without rebooting, you can also specifically match the newest two generations with something like:
activating the configuration...
setting up /etc...
<<< /nix/var/nix/profiles/system-36-link
>>> /nix/var/nix/profiles/system-37-link
Traceback (most recent call last):
File "/nix/store/rzmrp4hycdp39z2swr8l26s48x4i8xbi-nvd-0.1.2/bin/nvd", line 672, in <module>
main()
File "/nix/store/rzmrp4hycdp39z2swr8l26s48x4i8xbi-nvd-0.1.2/bin/nvd", line 664, in main
{
File "/nix/store/rzmrp4hycdp39z2swr8l26s48x4i8xbi-nvd-0.1.2/bin/nvd", line 495, in run_diff
left_manifest = PackageManifest.parse_tree((left_resolved / "sw").resolve())
File "/nix/store/rzmrp4hycdp39z2swr8l26s48x4i8xbi-nvd-0.1.2/bin/nvd", line 231, in parse_tree
direct_deps: List[str] = subprocess.run(
File "/nix/store/9wa02q541sxq7372f8zv27rl57aribxj-python3-3.10.5/lib/python3.10/subprocess.py", line 501, in run
with Popen(*popenargs, **kwargs) as process:
File "/nix/store/9wa02q541sxq7372f8zv27rl57aribxj-python3-3.10.5/lib/python3.10/subprocess.py", line 969, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/nix/store/9wa02q541sxq7372f8zv27rl57aribxj-python3-3.10.5/lib/python3.10/subprocess.py", line 1845, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'nix-store'
Activation script snippet 'report-changes' failed (1)
I guess this is because nix-store is not available. Do you have any idea on how to fix this ?