My workflow for adding packages to nixpkgs
Posted on 07, Oct 2014
git clone https://github.com/NixOS/nixpkgs.git cd nixpkgs
If you think you need to add a package, make sure you actually do first by searching for it in the repository:
grep -Rsin geant pkgs/
Ok. It is not there, so the first thing we need to do is make a new branch, and add it in a sensible place.
git branch geant4 git checkout geant4
and add a new category called
, and a sub directory called
mkdir -p pkgs/development/libraries/physics/geant4/
In this directory we will add our nix expression for GEANT4:
This expression will contain everything needed to build the software. More on that in a later post. Once you have made your changes you can test your expression by attempting to build the package:
nix-build -A geant4
Or drop into a shell and play around:
nix-shell -A geant4 $> cd /tmp $> unpackPhase $> cd <source dir> $> cmakeConfigurePhase $> buildPhase $> exit
If it is all working as you expect, and the package builds correctly you can commit your changes:
git add pkgs/development/libraries/physics/geant4/<files> git commit -m "Added geant4."
Finally, you can push this branch to your forked repository on github, and open a pull request:
git push -u origin geant4
Here is the original pull request for adding GEANT4 to nixpkgs .
Copyright, Christopher Poole 2008-2016.