Nixpkgs: Difference between revisions

imported>Samueldr
m Channels: main article link
imported>Wizzup
Hack Nixpkgs: some restructure
Line 43: Line 43:
==== Hack Nixpkgs ====
==== Hack Nixpkgs ====


Make any modifications you want to your local copy of the repository, then build the package with: <syntaxhighlight lang="bash">nix-build -A $yourpackage</syntaxhighlight>
Make any modifications you want to your local copy of the repository, then build the package with: <syntaxhighlight lang="bash">nix-build -A $yourpackage -I nixpkgs=/path/to/local/nixpkgs</syntaxhighlight>
 
The output of your build will be located under the <code>result/</code> subdirectory. Try running the freshly built binaries in <code>result/bin</code> and check that everything is OK.


To test the changes on a NixOS machine, rebuild the system using your newly hacked Nixpkgs by executing:
To test the changes on a NixOS machine, rebuild the system using your newly hacked Nixpkgs by executing:
Line 50: Line 52:
sudo nixos-rebuild switch -I nixpkgs=/path/to/local/nixpkgs
sudo nixos-rebuild switch -I nixpkgs=/path/to/local/nixpkgs
</syntaxhighlight>
</syntaxhighlight>
The output of your build will be located under the <code>result/</code> subdirectory. Try running the freshly built binaries in <code>result/bin</code> and check that everything is OK.


==== Commit your change locally ====
==== Commit your change locally ====