Open KiaraGrouwstra opened 9 months ago
I started with Nix recently and also stumbled into this. It's very nice that I can update from one locked state to another locked state. But it would be great if you could see exactly what packages updates between each lock. Like a chanelog basically
This looks rather hard to do. A Nixpkgs update is likely to involve updating thousands of packages, and there's no real way to know which ones are relevant in the general case.
There could be something (but probably not built into Nix) that could add some nix diff-closures
on top:
#!/usr/bin/env bash
set -euo pipefail
before_update=$(nix build --no-link --print-out-paths .)
nix flake update
after_update=$(nix build --no-link --print-out-paths .)
nix store diff-closures "$before_update" "$after_update"
$ bash diff-closure.sh
• Updated input 'nixpkgs':
'path:/nix/store/yy19v2dwb8ldphvia9smajvwv3ycx2c1-source?lastModified=1705331948&narHash=sha256-qjQXfvrAT1/RKDFAMdl8Hw3m4tLVvMCc8fMqzJv0pP4%3D&rev=b8dd8be3c790215716e7c12b247f45ca525867e2' (2024-01-15)
→ 'github:nixos/nixpkgs/70bdadeb94ffc8806c0570eb5c2695ad29f0e421' (2024-01-03)
bash: -41.3 KiB
gawk: 5.2.1 → 5.2.2, +15.0 KiB
glibc: 2.37-45 → 2.38-27
vim: 9.0.1441 → 9.0.2048, +860.4 KiB
xgcc: 12.2.0 → 12.3.0
i'd mostly mentioned packages from flake-based sources, tho i guess nix flake update
also updates non-flake sources. for those i wonder if we could read git tags associated with commits included in an update to get a sense of versions updated to. perhaps that would be more of a follow-up to the present ticket tho.
For reference, a similar topic was also discussed in discourse relatively recently: https://discourse.nixos.org/t/what-packages-will-get-updated/36057.
The commands referenced there did give me some sense of what got upgraded:
nix store diff-closures /run/*-system/
Output:
docker: 26.1.3 → 26.1.4
docker-containerd: 26.1.3 → 26.1.4
docker-init: 26.1.3 → 26.1.4
docker-runc: 26.1.3 → 26.1.4
initrd-linux: 6.6.32 → 6.6.33
linux: 6.6.32, 6.6.32-modules → 6.6.33, 6.6.33-modules, -667.3 KiB
moby: 26.1.3 → 26.1.4
nixos-system-nixos: 24.05.20240609.2819fff → 24.05.20240615.752c634
source: +68.3 KiB
However, my flake contains more stuff, packages installed using home-manager - I am not sure how to check if those packages (for example, neovim, jq, etc.) are listed here 🤔
Is your feature request related to a problem? Please describe. Using flakes in version control allows one to fully trace what changed among your dependencies. And in fact, commands like
nix flake update --commit-lock-file
definitely facilitate this, committing messages along the lines of:This level of traceability is awesome, allowing users to:
While there are limits to what we can automate of those processes, I feel we might be able to improve a bit on the level of info we offer there now.
Describe the solution you'd like In commit messages for example, it could already be valuable to allow having it add info on package version updates, e.g.:
However, for interfaces more aimed at humans, I feel we could also go further than that, like adding hyperlinks to find out more about:
web pages of the packages, so people can go look for change logsmeta.changelog
to find out more about those version changesDescribe alternatives you've considered stare at a list of hashes, then run
Additional context i am a fallible human being failing to always verify which packages got updated between two commit hashes