diff --git a/nixos/doc/manual/development.xml b/nixos/doc/manual/development.xml index 6873710205d..2f0c2a7aa8d 100644 --- a/nixos/doc/manual/development.xml +++ b/nixos/doc/manual/development.xml @@ -39,7 +39,37 @@ This will check out the latest NixOS sources to and the Nixpkgs sources to /my/sources/nixpkgs. (The NixOS source tree lives in a subdirectory of the Nixpkgs -repository.) If you want to rebuild your system using your (modified) +repository.) + +It’s often inconvenient to develop directly on the master +branch, since if somebody has just committed (say) a change to GCC, +then the binary cache may not have caught up yet and you’ll have to +rebuild everything from source. So you may want to create a local +branch based on your current NixOS version: + + +$ nixos-version +14.04.273.ea1952b (Baboon) + +$ git checkout -b local ea1952b + + +Or, to base your local branch on the latest version available in the +NixOS channel: + + +$ curl -sI http://nixos.org/channels/nixos-unstable/ | grep Location +Location: http://releases.nixos.org/nixos/unstable/nixos-14.10pre43986.acaf4a6/ + +$ git checkout -b local acaf4a6 + + +You can then use git rebase to sync your local +branch with the upstream branch, and use git +cherry-pick to copy commits from your local branch to the +upstream branch. + +If you want to rebuild your system using your (modified) sources, you need to tell nixos-rebuild about them using the flag: