Skip to content

Merge NixOS into Nixpkgs #1041

Closed
edolstra opened this Issue Oct 4, 2013 · 19 comments
@edolstra
Official Nix/Nixpkgs/NixOS member
edolstra commented Oct 4, 2013

I'd like to merge the NixOS tree into the Nixpkgs repository, as has been discussed a few times in the past. The reasons for merging them are:

  • Changes in Nixpkgs often require a change in NixOS and vice versa. With separate repositories, this means you need to do two commits, which is not atomic and creates the possibility of trees being out of sync with each other.

  • Branches in Nixpkgs often require corresponding branches in NixOS. For instance, a Nixpkgs branch like multiple-outputs requires a branch in NixOS because it changes the structure of some packages.

  • Issue tracking: it's often unclear whether an issue should be reported in the NixOS or Nixpkgs issue tracker, and often the fix is in the other repository.

  • The NixOS version is currently a 2-tuple of Git hashes. Merging NixOS and Nixpkgs allows the NixOS version to be identified using a single Git hash.

There are also downsides to merging:

  • It makes the Nixpkgs tree a bit bigger, which may be slightly annoying for people who only use Nixpkgs and not NixOS.

  • It makes it harder to build a NixOS tree against a different Nixpkgs tree. But given the tight coupling between these trees, that doesn't work very well in practice anyway. OTOH, it becomes much easier to use multiple Nixpkgs trees in a NixOps deployment (since there are no more <nixpkgs> references).

I did a test merge, available here: https://github.com/edolstra/nixpkgs/tree/merge-test. It imports nixos/master as a subdirectory "nixos" in the root directory of Nixpkgs (keeping all history). While I was at it, I also renamed pkgs/lib to lib because it never really made sense to have it in pkgs.

Note that GitHub unfortunately doesn't show history across renames, but "git log --follow" does (and GitHub's "blame" also works fine).

@edolstra edolstra was assigned Oct 4, 2013
@viric
Official Nix/Nixpkgs/NixOS member
viric commented Oct 4, 2013
@bluescreen303
@edolstra
Official Nix/Nixpkgs/NixOS member
edolstra commented Oct 4, 2013

@bluescreen303 Yeah, that's basically why I want to do this now. If we do it after the release, we'll have to keep two repositories alive for a while.

@vcunat
Official Nix/Nixpkgs/NixOS member
vcunat commented Oct 4, 2013

For the downsides:

  • The sizes of nixpkgs vs. nixos is on the order of 10:1 and I don't think it would decrease much in future, rather the other way.
  • I think you can get the combination in your work tree in two commands. First git-checkout the whole tree for the "nixpkgs version", and then git-checkout the nixos subtree for the "nixos version".
@vcunat
Official Nix/Nixpkgs/NixOS member
vcunat commented Oct 4, 2013

What I'm not clear about: can we somehow "merge" the github issues/PRs? There are quite many for both nixos and nixpkgs.

@edolstra
Official Nix/Nixpkgs/NixOS member
edolstra commented Oct 4, 2013

There is a script to move issues to another GitHub project, but it doesn't keep comment authorship: https://github.com/collective/collective.developermanual/blob/master/gh-issues-import.py

@the-kenny

I just wrote a mail to Github asking if they know a way to merge projects while keeping all issues with comments.

@edolstra
Official Nix/Nixpkgs/NixOS member
edolstra commented Oct 4, 2013

Cool, thanks!

@bjornfor
bjornfor commented Oct 5, 2013

I use nixpkgs on Ubuntu on a couple of machines, but still +1 for merging. Looking forward to easily git bisect the whole of NixOS and more easily recreate exact builds (no more manual work to match nixos/nixpkgs versions).

@domenkozar
Official Nix/Nixpkgs/NixOS member

+1

@MarcWeber

I'm fine with this change, too.

There are more reasons to merge: Eg should "creating an iso or an usb image of nixos" be a nixpkgs or a nixos project?

The more I think about it the earlier this should be done.

@garbas
garbas commented Oct 6, 2013

awesome! :beer:

@offlinehacker
@edolstra
Official Nix/Nixpkgs/NixOS member

Okay, I'll do the merge now. Cross fingers...

I'll turn off commits to the NixOS repo first.

@offlinehacker

Do we have to reopen pull requests now or will they be handled in any other way?

@MarcWeber
@domenkozar
Official Nix/Nixpkgs/NixOS member

This can be closed?

@edolstra
Official Nix/Nixpkgs/NixOS member

Yes, closing now...

@edolstra edolstra closed this Oct 27, 2013
@grwlf
grwlf commented Oct 29, 2013

Thanks, +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.