My main question: How does NixOS track different builds of generations?
To qualify that question at length, I’ve read the NixOS official doc on the Nix Language twice and I re-read Ryan’s incredible book on Flakes a few times already. But I have some outstanding lingering questions I can’t answer based on my reading so far.
Here goes - -
If the NixOS package manager builds based on references to commit hashes instead of versioning tags, then that means there could theoretically be as many different packages as there are thousands of commits in a given application’s source code repository. I can’t possibly expect NixOS package maintainers to build, store, host, and distribute all those unique binaries on package servers, right?
I see in the searchable package repositories, versions are consistent overtime and only change with major releases that correspond to tags on GitHub.
- Does this mean that the fluid package versioning according to commit hashes is only for Home-Manager which is used more so by developers who are testing recent changes on a beta release for a project that they are writing / contributing to?
- Does this also mean that with Flakes and Home-Manager, individual packages are assembled and compiled from source like Gentoo? Does this mean that the more a NixOS admin uses Flakes and Home-Manager, maintenance more closely resembles a source based distro?
To use an example to better illustrate my point, the latest release of Hyprland is v0.37.1. It came out like last week I believe. But the current NixOS stable package channel is “23.11” and the official searchable nixpkgs repo for this channel shows Hyprland v0.32.3. It’s obsolete. If I wanted a more recent version, I could switch my NixOS package channel to ‘unstable’ which would then download and install Hyprland v0.36.0, which is still not the latest. If I really wanted bleeding edge, I would need to compile v0.37.1 from source. The best way to do that would be to use a Flakes script for Home Manager. Is this correct?
So if I wanted to generate a local repository with a comprehensive history of the last 5 major Hyprland releases, I wouldn’t be able to do that with nixpkgs. I’d have to compile all that source code for each commit hash of my choice using Flakes and Home-Manager. Then I could flip the symlinks from one generation to the next, back and forth, up and down. Of course I don’t actually have a need or purpose to handle different versions of Hyprland as such, as a novice I am merely asking to better distinguish and wrap my mind around nixpkgs, Flakes, and how NixOS package management works in general.