NixOS / nixos-channel-scripts

33 stars 28 forks source link

get programs.sqlite with flakes #54

Open wmertens opened 2 years ago

wmertens commented 2 years ago

Now that we're moving towards flakes instead of channels, the injected programs.sqlite is no longer available.

What would be a good way to provide this information?

It could be injected in nixpkgs as a commit on the just-built branch, but that seems rather crude. Perhaps in a different repo that has the same branch names as the ones that hydra makes on nixpkgs?

SuperSandro2000 commented 2 years ago

Putting it into the nixpkgs repo would blew up it's size by a lot. Wouldn't recommend that.

I am fetching it like this:

inputs.nixos-channel.url = "https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz";
programs.command-not-found = {
  enable = true;
  dbPath = "${inputs.nixos-channel}/programs.sqlite";
};
wmertens commented 2 years ago

Well, the commits with the db would only go on build branches and so there wouldn't be a history of them. Every time a build branch is updated, the previous commit would no longer be referenced and eventually GC-ed.

What I don't like about your solution is downloading the whole channel to get only that single file.

ElvishJerricco commented 2 years ago

@wmertens The release-XX.YY branches just add new commits, so adding this DB to those branches would mean the history would be full of them, which is really bad since people actually do nixpkgs dev work on those branches. The nixos-XX.YY branches always just point to commits from the corresponding release branch.

wamserma commented 1 year ago

Just for reference: https://github.com/wamserma/flake-programs-sqlite/ is basically a fancy wrapper around @SuperSandro2000's solution from above, which provides FODs for programs.sqlite.

zimbatm commented 1 year ago

See also https://github.com/nix-community/nix-index-database