Keeping my Nix inputs fresh (www.jimmyff.co.uk)

🤖 AI Summary
Nix’s strict reproducibility model means packages live in read-only store paths and won’t self-update, so the author—after switching to Nix full-time—found it painful to update everything at once. To match different update cadences (AI tools daily, dev tools weekly, desktop monthly) they split nixpkgs into specialized flake inputs (pkgs-ai, pkgs-dev-tools, pkgs-desktop) but lacked an easy way to see which inputs actually had new upstream revisions. To solve that, they wrote a small nushell script called flake-freshness that compares the flake.lock entries against upstream revisions, caches results to avoid repeated and expensive nix eval calls, and runs at system startup to give a quick status overview before deciding what to update. The approach is significant because it provides a lightweight, reproducible pattern for selectively refreshing parts of a Nix-managed system without breaking the whole configuration. Key technical details: it inspects flake.lock versions vs upstream, uses caching to reduce nix evaluation overhead, is implemented in nushell for portability in the user’s dotfiles, and integrates into boot-time checks. The repo with the script and other Nix config is available at github.com/jimmyff/nixfiles, offering a practical template for others who want finer-grained update control in flake-based workflows.
Loading comments...
loading comments...