nixpkgs/installer/nixos-checkout.sh
Eelco Dolstra 9fd5d70968 * The CD is now a true live CD: you can run Nix operations in it
thanks to unionfs.  For instance, nix-env and nixos-rebuild work.
  The tricky part was to build a Nix database (in the tmpfs/unionfs)
  which is now necessary to prevent store paths on the CD from being
  deleted right away because they otherwise wouldn't be valid.
  
* nixos-install: use the /etc/nixos/configuration.nix from the target
  file system (don't copy it anymore).  Since the user is supposed to
  mount the target file system on /mnt anyway, we may as well require
  that configuration.nix is placed in /mnt/etc/nixos.  This also makes
  upgrading / reinstalling much easier, since it will automatically
  use the right configuration.nix.

svn path=/nixos/trunk/; revision=10399
2008-01-30 01:28:56 +00:00

36 lines
949 B
Bash

#! @shell@ -e
set -x
# Obtain Subversion.
if test -z "$(type -tp svn)"; then
#nix-channel --add http://nix.cs.uu.nl/dist/nix/channels-v3/nixpkgs-unstable
#nix-channel --update
nix-env -i subversion
fi
cd /etc/nixos
# Move any old nixos or nixpkgs directories out of the way.
backupTimestamp=$(date "+%Y%m%d%H%M%S")
if test -e nixos -a ! -e nixos/.svn; then
mv nixos nixos-$backupTimestamp
fi
if test -e nixpkgs -a ! -e nixpkgs/.svn; then
mv nixpkgs nixpkgs-$backupTimestamp
fi
if test -e services -a ! -e services/.svn; then
mv nixos/services services-$backupTimestamp
fi
# Check out the NixOS and Nixpkgs sources.
svn co https://svn.cs.uu.nl:12443/repos/trace/nixos/trunk nixos
svn co https://svn.cs.uu.nl:12443/repos/trace/nixpkgs/trunk nixpkgs
svn co https://svn.cs.uu.nl:12443/repos/trace/services/trunk services
# Add a few required symlink.
ln -sfn ../services nixos/services
ln -sfn ../nixpkgs/pkgs nixos/pkgs