Author: eelco
Date: Mon May 14 04:12:43 2012
New Revision: 34086
URL: https://nixos.org/websvn/nix/?rev=34086&sc=1

Log:
* nixos-checkout: add an argument to specify the directory where the
  sources should be stored.  E.g. "nixos-checkout /home/eelco/srcs"
  will check out to /home/eelco/srcs/{nixos,nixpkgs}.  Probably the
  /etc/nixos default should be removed eventually because /etc is a
  pretty weird place to keep large source trees.

Modified:
   nixos/trunk/doc/manual/development.xml
   nixos/trunk/modules/installer/tools/nixos-checkout.nix

Modified: nixos/trunk/doc/manual/development.xml
==============================================================================
--- nixos/trunk/doc/manual/development.xml      Mon May 14 04:01:47 2012        
(r34085)
+++ nixos/trunk/doc/manual/development.xml      Mon May 14 04:12:43 2012        
(r34086)
@@ -21,18 +21,19 @@
 Subversion.  This is done using the following command:
 
 <screen>
-$ nixos-checkout
+$ nixos-checkout <replaceable>/my/sources</replaceable>
 </screen>
 
 This will check out the latest NixOS sources to
-<filename>/etc/nixos/nixos</filename> and the Nixpkgs sources to
-<filename>/etc/nixos/nixpkgs</filename>.  If you want to rebuild your
-system using your (modified) sources, you need to tell
-<command>nixos-rebuild</command> about them using the
+<filename><replaceable>/my/sources</replaceable>/nixos</filename> and
+the Nixpkgs sources to
+<filename><replaceable>/my/sources</replaceable>/nixpkgs</filename>.
+If you want to rebuild your system using your (modified) sources, you
+need to tell <command>nixos-rebuild</command> about them using the
 <option>-I</option> flag:
 
 <screen>
-$ nixos-rebuild -I /etc/nixos
+$ nixos-rebuild switch -I <replaceable>/my/sources</replaceable>
 </screen>
 
 </para>

Modified: nixos/trunk/modules/installer/tools/nixos-checkout.nix
==============================================================================
--- nixos/trunk/modules/installer/tools/nixos-checkout.nix      Mon May 14 
04:01:47 2012        (r34085)
+++ nixos/trunk/modules/installer/tools/nixos-checkout.nix      Mon May 14 
04:12:43 2012        (r34086)
@@ -14,7 +14,12 @@
     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")
_______________________________________________
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to