Get In Touch: Difference between revisions

From NixOS Wiki
imported>Ixxie
Added Hack Nixpkgs section
imported>Ixxie
Moved Contributing section to Nixpkgs article and replaced it with a small summary.
Line 1: Line 1:
Next to the [https://nixos.org/nixos/community.html ''Contributing to NixOS'' section at the ''NixOS community'' page on the official NixOS website] we want to additionally describe how you can get involved in the NixOS ecosystem.
Next to the [https://nixos.org/nixos/community.html ''Contributing to NixOS'' section at the ''NixOS community'' page on the official NixOS website] we want to additionally describe how you can get involved in the NixOS ecosystem.


== Working on the Nixpkgs repository ==
== Development ==


Development in NixOS primarily driven by the work in [https://github.com/nixos/nixpkgs nixpkgs on github]. This repository contains both all packages available in your NixOS channel and all the options you can use for configuring your system with your <code>configuration.nix</code>. To get your text editor to recognize Nix expressions, consider installing a Nix [https://github.com/nixos-users/wiki/wiki/Editor-Modes editor mode].
Development of [[Nix]] and [[NixOS]] happens primarily on [[Nixpkgs]]. You can contribute by helping reporting, diagnosing  and closing issues, by creating, testing and reviewing pull-requests, and by becoming a maintainer of packages and modules hosted on the repository. For more information, see [[Nixpkgs#Contributing the contributing section of the Nixpkgs article]].
 
=== Report issues ===
 
Any issue can be reported in the nixpkgs issue-tracker [https://github.com/nixos/nixpkgs/issues on github]. Keep in mind that all work on nixpkgs is being done by volunteers and you cannot expect a quick response and solution for all problems you may face. In general Pull-Requests have a much shorter round-trip-time.
 
=== Create pull requests ===
 
If you want to see your package being provided by a channel, creating an issue will most likely not enough. It is up to you to create a [[Contributing to Nixpkgs|nix package description]] in Nixpkgs and create a pull request in the Nixpkgs repository. Pull requests are a way to tell a github project that you've created some changes, which maintainers can easily review, comment on and, and finally merge into the repository.
 
Here's how to create a pull request on GitHub:
 
==== Fork Nixpkgs on Github ====
 
Create a GitHub account and fork nixpkgs/nixos/... repository.
 
==== Add a remote ====
 
On your host, create a new remote location:
<syntaxhighlight lang="bash">
# add your github clone as remote location:
YOUR_GITHUB_NAME=fill-in
git remote add $YOUR_GITHUB_NAME git@github.com:$YOUR_GITHUB_NAME/nixpkgs.git
</syntaxhighlight>
 
==== Hack Nixpkgs ====
 
Make any modifications you want to your local copy of the repository. To test the changes on a NixOS machine, rebuild the system using your newly hacked Nixpkgs by executing:
 
<syntaxhighlight lang="bash">
sudo nixos-rebuild switch -I nixpkgs=/path/to/local/nixpkgs
</syntaxhighlight>
 
==== Commit your change locally ====
 
Commit your change to your local clone of the repository:
<syntaxhighlight lang="bash">
git add FILE_LIST # eventually use git add --patch
git commit
 
==== Check status ====
 
Verify everything is ok - no unexpected dangling files git does not know about yet:
git status
</syntaxhighlight>
 
==== Push to your remote repository ====
 
Submitting your change, push to your repository:
 
<syntaxhighlight lang="bash">
# recommended: create a topic branch, so that this change
# can be submitted independently from other patches:
git checkout -tb submit/your-topic-name
git push $YOUR_GITHUB_NAME submit/your-topic-name
</syntaxhighlight>
 
Why create your own branch? You can follow upstream (master) by running <code>git merge master</code>.
You can <code>git commit --amend</code> fixes and <code>git push -f</code> your branch.
You can always switch back to master by <code>git checkout master</code>.
 
==== Create a pull request on GitHub ====
 
Go to [https://github.com/nixos/nixpkgs the Nixpkgs repository] and push the ''create pull request'' button. Add a description of your work and submit.
 
=== Becoming a Nixpkgs maintainer ===
 
There are two types of maintainer: Members of the NixOS organization and package/module maintainer.
 
Members of the NixOS organization have direct access to the [https://github.com/Nixos/nixpkgs nixpkgs] and can therefor can merge [[Create-pull-requests|pull requests]].
 
Everybody can become a package maintainer by adding to <code>maintainers</code> attribute in the meta section of a package. First add your nick handle (preferable your GitHub username) to [https://github.com/NixOS/nixpkgs/blob/master/lib/maintainers.nix#L3 lib/maintainer.nix] and reference the said handle within the package:
 
<syntaxhighlight lang="nix">{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
  name = "hello-2.10";
  # ....
  meta = with stdenv.lib; {
    # ...
    maintainers = with maintainers; [ eelco your-nick ]; # replace your-nick with your real nick
    platforms = platforms.all;
  };
}</syntaxhighlight>
There can be multiple maintainers per package. Maintainers will receive emails from [[Hydra|Hydra]] when package builds enters a failed state. They do not have special privileges as everybody can suggest updates and modifications to any package. However they might be consulted by NixOS members for testing and as a domain experts, when somebody else make a change to a package.


== Communication ==
== Communication ==

Revision as of 09:30, 9 December 2017

Next to the Contributing to NixOS section at the NixOS community page on the official NixOS website we want to additionally describe how you can get involved in the NixOS ecosystem.

Development

Development of Nix and NixOS happens primarily on Nixpkgs. You can contribute by helping reporting, diagnosing and closing issues, by creating, testing and reviewing pull-requests, and by becoming a maintainer of packages and modules hosted on the repository. For more information, see Nixpkgs#Contributing the contributing section of the Nixpkgs article.

Communication

Join the mailinglist

There is currently only one official Mailinglist related to NixOS, nix-devel. You don't need to be a developer to use nix-devel.

Join the chat

The official NixOS channel resides on irc.freenode.org in #nixos (searchable Log) and the wiki channel is at #nixos-wiki.

In addition to that there is also the unofficial NixOS matrix channel

Join the forums

Check out the NixOS Reddit channel and help answering questions on Stack Overflow for NixOS and nix.