2006-11-12 18:48:47 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
# The label used to identify the installation CD.
|
|
|
|
cdromLabel = "NIXOS";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
# Build boot scripts for the CD that find the CD-ROM automatically.
|
2006-11-13 16:19:57 +00:00
|
|
|
with import ./boot-environment.nix {
|
2006-11-12 18:48:47 +00:00
|
|
|
autoDetectRootDevice = true;
|
|
|
|
rootLabel = cdromLabel;
|
2006-11-13 11:41:27 +00:00
|
|
|
stage2Init = "/init";
|
|
|
|
readOnlyRoot = true;
|
2006-11-12 18:48:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
rec {
|
|
|
|
|
2006-11-13 11:41:27 +00:00
|
|
|
inherit nixosInstaller bootStage1; # !!! debug
|
2006-11-12 23:30:03 +00:00
|
|
|
|
2006-11-12 18:48:47 +00:00
|
|
|
|
|
|
|
# Since the CD is read-only, the mount points must be on disk.
|
|
|
|
cdMountPoints = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "mount-points";
|
|
|
|
builder = builtins.toFile "builder.sh" "
|
|
|
|
source $stdenv/setup
|
|
|
|
mkdir $out
|
|
|
|
cd $out
|
|
|
|
mkdir proc sys tmp etc dev var mnt nix nix/var
|
|
|
|
touch $out/${cdromLabel}
|
|
|
|
";
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
# Create an ISO image containing the isolinux boot loader, the
|
|
|
|
# kernel, the initrd produced above, and the closure of the stage 2
|
|
|
|
# init.
|
|
|
|
rescueCD = import ./make-iso9660-image.nix {
|
2006-11-17 14:13:21 +00:00
|
|
|
inherit (pkgs) stdenv cdrtools;
|
2006-11-12 18:48:47 +00:00
|
|
|
isoName = "nixos.iso";
|
|
|
|
|
|
|
|
contents = [
|
|
|
|
{ source = pkgs.syslinux + "/lib/syslinux/isolinux.bin";
|
|
|
|
target = "isolinux/isolinux.bin";
|
|
|
|
}
|
|
|
|
{ source = ./isolinux.cfg;
|
|
|
|
target = "isolinux/isolinux.cfg";
|
|
|
|
}
|
|
|
|
{ source = pkgs.kernel + "/vmlinuz";
|
|
|
|
target = "isolinux/vmlinuz";
|
|
|
|
}
|
|
|
|
{ source = initialRamdisk + "/initrd";
|
|
|
|
target = "isolinux/initrd";
|
|
|
|
}
|
|
|
|
{ source = cdMountPoints;
|
|
|
|
target = "/";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
init = bootStage2;
|
|
|
|
|
|
|
|
bootable = true;
|
|
|
|
bootImage = "isolinux/isolinux.bin";
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|