2006-12-16 18:24:49 +00:00
|
|
|
rec {
|
2006-11-12 18:48:47 +00:00
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
|
2007-01-09 23:12:41 +00:00
|
|
|
nixpkgsRel = "nixpkgs-0.11pre7593";
|
2007-01-09 21:19:06 +00:00
|
|
|
|
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
configuration = {
|
2007-01-08 23:10:29 +00:00
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
boot = {
|
|
|
|
autoDetectRootDevice = true;
|
|
|
|
readOnlyRoot = true;
|
|
|
|
# The label used to identify the installation CD.
|
|
|
|
rootLabel = "NIXOS";
|
|
|
|
};
|
2007-01-08 23:10:29 +00:00
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
services = {
|
2007-01-08 23:10:29 +00:00
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
sshd = {
|
|
|
|
enable = false;
|
|
|
|
};
|
2007-01-08 23:10:29 +00:00
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
xserver = {
|
|
|
|
enable = false;
|
|
|
|
};
|
2007-01-08 23:10:29 +00:00
|
|
|
|
|
|
|
# Allow the user to do something useful on tty8 while waiting
|
|
|
|
# for the installation to finish.
|
|
|
|
extraJobs = [
|
|
|
|
{ name = "rogue";
|
|
|
|
job = "
|
|
|
|
start on udev
|
|
|
|
stop on shutdown
|
|
|
|
respawn ${pkgs.rogue}/bin/rogue < /dev/tty8 > /dev/tty8 2>&1
|
|
|
|
";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
# And a background to go with that.
|
|
|
|
ttyBackgrounds = {
|
|
|
|
specificThemes = [
|
|
|
|
{ tty = 8;
|
|
|
|
theme = pkgs.fetchurl {
|
|
|
|
url = http://www.bootsplash.de/files/themes/Theme-GNU.tar.bz2;
|
|
|
|
md5 = "61969309d23c631e57b0a311102ef034";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
};
|
2007-01-09 21:19:06 +00:00
|
|
|
|
|
|
|
installer = {
|
|
|
|
nixpkgsURL = http://nix.cs.uu.nl/dist/nix/ + nixpkgsRel;
|
|
|
|
};
|
2007-01-08 23:10:29 +00:00
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
};
|
2006-11-12 18:48:47 +00:00
|
|
|
|
|
|
|
|
2007-01-04 10:31:36 +00:00
|
|
|
system = import ../system/system.nix {
|
2006-12-16 18:24:49 +00:00
|
|
|
inherit configuration;
|
2006-11-13 11:41:27 +00:00
|
|
|
stage2Init = "/init";
|
2006-11-12 18:48:47 +00:00
|
|
|
};
|
|
|
|
|
2006-11-12 23:30:03 +00:00
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
pkgs = system.pkgs;
|
|
|
|
|
2006-11-12 18:48:47 +00:00
|
|
|
|
|
|
|
# Since the CD is read-only, the mount points must be on disk.
|
2006-12-10 22:43:04 +00:00
|
|
|
cdMountPoints = pkgs.runCommand "mount-points" {} "
|
|
|
|
ensureDir $out
|
|
|
|
cd $out
|
2006-12-16 21:48:12 +00:00
|
|
|
mkdir proc sys tmp etc dev var mnt nix nix/var root
|
2006-12-16 18:24:49 +00:00
|
|
|
touch $out/${configuration.boot.rootLabel}
|
2006-12-10 22:43:04 +00:00
|
|
|
";
|
2006-11-12 18:48:47 +00:00
|
|
|
|
|
|
|
|
2006-11-17 15:27:31 +00:00
|
|
|
# We need a copy of the Nix expressions for Nixpkgs and NixOS on the
|
|
|
|
# CD. We put them in a tarball because accessing that many small
|
|
|
|
# files from a slow device like a CD-ROM takes too long.
|
2006-12-16 18:24:49 +00:00
|
|
|
makeTarball = tarName: input: pkgs.runCommand "tarball" {inherit tarName;} "
|
2006-12-10 22:43:04 +00:00
|
|
|
ensureDir $out
|
|
|
|
(cd ${input} && tar cvfj $out/${tarName} . \\
|
2006-12-16 18:24:49 +00:00
|
|
|
--exclude '*~' \\
|
2006-12-10 22:43:04 +00:00
|
|
|
--exclude 'pkgs' --exclude 'result')
|
|
|
|
";
|
2006-11-17 15:27:31 +00:00
|
|
|
|
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
# Put the current directory in a tarball (making sure to filter
|
|
|
|
# out crap like the .svn directories).
|
|
|
|
nixosTarball = makeTarball "nixos.tar.bz2" (builtins.filterSource
|
|
|
|
(name: let base = baseNameOf (toString name); in base != ".svn" && base != "result") ./..);
|
|
|
|
|
|
|
|
|
|
|
|
# Get a recent copy of Nixpkgs.
|
2006-11-17 15:27:31 +00:00
|
|
|
nixpkgsTarball = pkgs.fetchurl {
|
2007-01-09 21:19:06 +00:00
|
|
|
url = configuration.installer.nixpkgsURL + "/" + nixpkgsRel + ".tar.bz2";
|
2007-01-09 23:12:41 +00:00
|
|
|
md5 = "fd443fb8b1c4d352d9a8b7d19dfb7c49";
|
2006-11-17 15:27:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-12-16 21:48:12 +00:00
|
|
|
# The configuration file for isolinux.
|
|
|
|
isolinuxCfg = pkgs.writeText "isolinux.cfg" "
|
|
|
|
default linux
|
|
|
|
prompt 1
|
|
|
|
timeout 60
|
|
|
|
label linux
|
|
|
|
kernel vmlinuz
|
|
|
|
append initrd=initrd ${toString (system.config.get ["boot" "kernelParams"])}
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-11-12 18:48:47 +00:00
|
|
|
# Create an ISO image containing the isolinux boot loader, the
|
|
|
|
# kernel, the initrd produced above, and the closure of the stage 2
|
|
|
|
# init.
|
2006-11-28 10:45:21 +00:00
|
|
|
rescueCD = import ../helpers/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";
|
|
|
|
}
|
2006-12-16 21:48:12 +00:00
|
|
|
{ source = isolinuxCfg;
|
2006-11-12 18:48:47 +00:00
|
|
|
target = "isolinux/isolinux.cfg";
|
|
|
|
}
|
|
|
|
{ source = pkgs.kernel + "/vmlinuz";
|
|
|
|
target = "isolinux/vmlinuz";
|
|
|
|
}
|
2006-12-16 18:24:49 +00:00
|
|
|
{ source = system.initialRamdisk + "/initrd";
|
2006-11-12 18:48:47 +00:00
|
|
|
target = "isolinux/initrd";
|
|
|
|
}
|
|
|
|
{ source = cdMountPoints;
|
|
|
|
target = "/";
|
|
|
|
}
|
2006-11-17 15:27:31 +00:00
|
|
|
{ source = nixosTarball + "/" + nixosTarball.tarName;
|
|
|
|
target = "/" + nixosTarball.tarName;
|
|
|
|
}
|
|
|
|
{ source = nixpkgsTarball;
|
|
|
|
target = "/nixpkgs.tar.bz2";
|
|
|
|
}
|
2006-11-12 18:48:47 +00:00
|
|
|
];
|
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
init = system.bootStage2;
|
2006-11-12 18:48:47 +00:00
|
|
|
|
|
|
|
bootable = true;
|
|
|
|
bootImage = "isolinux/isolinux.bin";
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|