Nixpkgs: Difference between revisions
imported>Asymmetric Added more info about nixos-unstable (insipred by https://gist.github.com/grahamc/c60578c6e6928043d29a427361634df6) |
imported>Asymmetric →Hack Nixpkgs: Add info about building and running binaries. |
||
Line 42: | Line 42: | ||
==== Hack Nixpkgs ==== | ==== Hack Nixpkgs ==== | ||
Make any modifications you want to your local copy of the repository | 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> | ||
To test the changes on a NixOS machine, rebuild the system using your newly hacked Nixpkgs by executing: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
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 ==== |