diff --git a/doc/manual/development.xml b/doc/manual/development.xml index 918bbe08a1a..017a0f007fa 100644 --- a/doc/manual/development.xml +++ b/doc/manual/development.xml @@ -21,18 +21,19 @@ To modify NixOS, however, you should check out the latest sources from Subversion. This is done using the following command: -$ nixos-checkout +$ nixos-checkout /my/sources This will check out the latest NixOS sources to -/etc/nixos/nixos and the Nixpkgs sources to -/etc/nixos/nixpkgs. If you want to rebuild your -system using your (modified) sources, you need to tell -nixos-rebuild about them using the +/my/sources/nixos and +the Nixpkgs sources to +/my/sources/nixpkgs. +If you want to rebuild your system using your (modified) sources, you +need to tell nixos-rebuild about them using the flag: -$ nixos-rebuild -I /etc/nixos +$ nixos-rebuild switch -I /my/sources diff --git a/modules/installer/tools/nixos-checkout.nix b/modules/installer/tools/nixos-checkout.nix index f90d24b0864..d591c01df19 100644 --- a/modules/installer/tools/nixos-checkout.nix +++ b/modules/installer/tools/nixos-checkout.nix @@ -14,7 +14,12 @@ let isExecutable = true; src = pkgs.writeScript "nixos-checkout" '' - cd /etc/nixos + #! ${pkgs.stdenv.shell} -e + + prefix="$1" + if [ -z "$prefix" ]; then prefix=/etc/nixos; fi + mkdir -p "$prefix" + cd "$prefix" # Move any old nixos or nixpkgs directories out of the way. backupTimestamp=$(date "+%Y%m%d%H%M%S")