nix-community / nix-index-database

Weekly updated nix-index database [maintainer=@Mic92]
MIT License
301 stars 29 forks source link

Support all current NixOS versions #127

Open me-and opened 1 month ago

me-and commented 1 month ago

118 noted that this index only generates caches for the nixos-unstable branch. I've created my own fork so I can have GitHub generate the database for my system for me. However, it seems to me that it should be possible for this repository to generate databases for all the current channels.

I don't (currently) have a good enough grasp of Flakes to write a PR for this myself, but I can think of a number of ways to achieve this. My default suggestion would be to get and parse the JSON channel list from https://prometheus.nixos.org/api/v1/query?query=channel_revision, then create the workflow matrix dynamically based on the output.

(I'm reaching to that solution in part because I have existing Nix code for parsing the channel data from that Prometheus URL and for dynamically building a GitHub matrix job based on a previous workflow job. The piece I'm missing is only how to update flake.nix…)

A simpler option that would require occasional manual maintenance would be to just list the channels to build manually in flake.nix and update.yml, and update that list whenever a new stable NixOS channel is released.

Mic92 commented 1 week ago

Having release branches for the last stable nixos release sounds like a good option to me.