Automating Overlay Package Updates (Can I do better?)

Hello.

I have recently automated the updating of my Wayland overlay. I package a variety of Wayland and wlroots related tools.

I have structured the repo such that every package has a metadata.nix that includes information about the upstream repo (supports git/hg), the tracked branch, the latest rev/sha256 for the package, etc. And then each package definition imports the metadata file.

Thus, I have written a script that uses that data, nix-prefetch, git ls-remote, etc to be able to update the package revs to HEAD. It seems to currently work with all of the packages that I currently have in the overlay.

However, it feels like something generic that could be implemented in another tool. But from my brief look around, everything comes up a bit short or doesn’t quite work the same way. Additionally, I might be shooting myself in the foot, but I’ve been reluctant to look at purely Haskell projects that might exist in this area due to my inexperience with Haskell and my general feelings of Haskell/nix codebases I’ve peaked at previously.

Anyway, here’s the script, it’s pretty straight forward – the only thing I haven’t mentioned is that it will also update pinned nixpkgs references as well, and that had to be special-cased a bit.

Most recent version: https://github.com/colemickens/nixpkgs-wayland/blob/master/update.sh
Version as of posting this comment: https://github.com/colemickens/nixpkgs-wayland/blob/913497406c7172658464cc9e17d68438dc2af718/update.sh

Ultimately, I’m looking for:

  • feedback on things I can improve
  • suggestions for a tool that covers these cases, and/or could grow to support them if I contrib’d
  • alternative ways to do this? I’ve seen the passthrough update script in nixpkgs tree before, but it has seemed that that was more for stable releases, etc…

Thanks!

1 Like

For those of you that consume this forum via email, I’m going to edit the original post to include the update script link that I’ve conveniently forgotten to include…

Most recent version: https://github.com/colemickens/nixpkgs-wayland/blob/913497406c7172658464cc9e17d68438dc2af718/update.sh
Version as of posting this comment: https://github.com/colemickens/nixpkgs-wayland/blob/913497406c7172658464cc9e17d68438dc2af718/update.sh

1 Like