So to make a PR, you first need to fork nixpkgs: goto GitHub - NixOS/nixpkgs: Nix Packages collection & NixOS and click on “fork” here:
You should be moved to your own fork (=copy) of nixpkgs, say GitHub - RudiOnTheAir/nixpkgs: Nix Packages collection & NixOS for instance. Then, you should be able to do something like:
# we clone nixpkgs
$ git clone https://github.com/NixOS/nixpkgs/
$ cd nixpkgs
# we add our fork as a remote to be able to send the changes there later:
$ git remote add myfork https://github.com/RudiOnTheAir/nixpkgs
# create a new branch with your changes
$ git checkout -b add_stereotool
Then you can do the above changes, notably adding your name in the list of maintainers via:
# add your name in this alphabetically sorted list, see instructions top of file (name of commit is important, it is parsed by bots)
$ kate maintainers/maintainer-list.nix
$ git commit -am "maintainers: add RudiOnTheAir"
Then, you need a second commit with the actual program. For that, create a file:
$ mkdir -p pkgs/by-name/st/stereotool/
$ kate pkgs/by-name/st/stereotool/package.nix
and put inside your derivations, like:
{ lib
, stdenv
, fetchurl
, autoPatchelfHook
}:
{
### Here goes all your derivation. See below for advices
}
You can test it by running at the root of nixpkgs’s repo:
$ nix-build -A stereotool
and it should create a ./result
folder with the binaries that you can test like:
$ ./result/bin/nameofyourbinary
Once you are happy with the result, and once the file is properly indented (you made a better job in your latest version, but watch out, you still have a few missing spaces that the bot will reject: if you have anything inside []
,{}
, or ()
, it should be shifted with two spaces compared to the previous line and next line), you can commit as follows:
$ git add pkgs/by-name/st/stereotool/package.nix
$ git commit -am "stereotool: init at 1.0.0"
$ git push myfork HEAD
(again, this is parsed by a bot, so be sure to get it right, of course update the version)
Then, go to GitHub - RudiOnTheAir/nixpkgs: Nix Packages collection & NixOS : you should now see a line like “you pushed some changes recently to the branch add_stereotool, do you want to make a Pull Request?”, just click OK, add a few lines explaining what you did, and submit it.
Give me a few mn, I’ll give you an example.