Nixpkgs: Merge nixpkgs-channels repo into nixpkgs

Created on 15 Oct 2019  路  10Comments  路  Source: NixOS/nixpkgs

Once upon a time, the nixpkgs-channels repo was created to prevent people from (accidentally) pushing to nixos-* branches. However, nowadays this can also be accomplished using branch protection. So we don't need a separate channels repo anymore. Having one repo has several advantages:

  • Simpler: no need to have two remotes in Git.
  • Less disk space: fetchGit stores clones of different repos separately, so if you do a fetchGit of both nixpkgs and nixpkgs-channels, you end up using twice the disk space.
  • Makes flakes easier to use: flake references allow you to override a branch (e.g. nix build nixpkgs/nixos-19.09#hello), but this doesn't work if the branch is in another repo (you'd have to say nix build github:NixOS/nixpkgs-channels/nixos-19.09#hello).

Proposal:

  • We add branch protection for the nixos-* and nixpkgs-* branches.
  • The channel updater script (https://github.com/NixOS/nixos-channel-scripts/blob/3e89acae6a263a0c0af0526c161a42c296bb4835/mirror-nixos-branch.pl#L226-L228) will start pushing to both nixpkgs and nixpkgs-channels (the latter for compatibility).
  • We remove references to nixpkgs-channels from the docs.
enhancement

Most helpful comment

The NixOS/nixpkgs-channels repo is still up and unredirected; if redirection isn't an option, perhaps the repository description should be changed to a deprecation notice and the repo marked as archived on GitHub?

All 10 comments

As a slightly related UX issue, it's unfortunate that we have tags named 19.03 etc. in the repo. This could cause people to inadvertently use a ref that doesn't get updates (e.g. nixpkgs/19.03 when they actually mean nixpkgs/nixos-19.03). IMHO we should rename the tags to something like 19.03-initial.

Is it possible to also redirect https://github.com/nixos/nixpkgs-channels to https://github.com/nixos/nixpkgs? I know this happens automatically if you move a repository but I don't know if you can set it up manually in circumstances like this.

Does anything in the release process use git describe? I think the tags must be 19.03 for this reason.

Where do we actually use the tags? I recall discussions they're confusing, because do they correspond to the release of a NixOS version, or to branch-off? See https://github.com/NixOS/nixpkgs/issues/64077.

According to the docs on releasing, the xx.yy-beta tag is created at branch-off time: https://nixos.org/nixos/manual/index.html#at-beta-release-time and the xx.yy tag is created on the first revision which passes hydra with stableBranch=true, https://nixos.org/nixos/manual/index.html#at-final-release-time

I don't think we use the tags anywhere (which also wouldn't make sense because we have rolling releases).

Looking at branch protection, we can do a few nice things:

  1. We could have the channel updater set a commit status, and require that status check for pushing. This makes it interesting to beable to look atGitHub's status check data to find all the channel bumps.
  2. We can restrict who can push to the branch, limiting it to a person, team, or app.

I think GitHub lets you merge two repos so that NixOS/nixpkgs-channels redirects to NixOS/nixpkgs and old references to NixOS/nixpkgs-channels would continue to work (provided we also include the old branches in NixOS/nixpkgs).

EDIT: this may just apply to renamed repos

The NixOS/nixpkgs-channels repo is still up and unredirected; if redirection isn't an option, perhaps the repository description should be changed to a deprecation notice and the repo marked as archived on GitHub?

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/github-com-nixos-nixpkgs-channels-deprecated/9455/3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nico202 picture nico202  路  70Comments

purefn picture purefn  路  68Comments

grahamc picture grahamc  路  77Comments

ttuegel picture ttuegel  路  98Comments

globin picture globin  路  65Comments