2008-01-30 10:42:48 +01:00
|
|
|
{
|
2008-06-06 12:04:27 +02:00
|
|
|
lib ? null
|
2008-01-30 10:42:48 +01:00
|
|
|
,platform ? __currentSystem
|
|
|
|
,networkNixpkgs ? ""
|
|
|
|
,nixpkgsMd5 ? ""
|
|
|
|
,manualEnabled ? true
|
|
|
|
,rogueEnabled ? true
|
|
|
|
,sshdEnabled ? false
|
|
|
|
,fontConfigEnabled ? false
|
|
|
|
,sudoEnable ? false
|
|
|
|
,packages ? (pkgs : [])
|
|
|
|
,includeMemtest ? true
|
|
|
|
,includeStdenv ? true
|
|
|
|
,includeBuildDeps ? false
|
2008-05-23 08:40:16 +02:00
|
|
|
,kernelPackages ? (pkgs : pkgs.kernelPackages)
|
|
|
|
,extraModulePackages ? (pkgs : [])
|
2008-01-30 10:42:48 +01:00
|
|
|
,addUsers ? []
|
|
|
|
,extraInitrdKernelModules ? []
|
|
|
|
,bootKernelModules ? []
|
|
|
|
,arbitraryOverrides ? (config:{})
|
|
|
|
,cleanStart ? false
|
|
|
|
|
|
|
|
/* Should return list of {configuration, suffix} attrsets.
|
|
|
|
{configuration=configuration; suffix=""} is always prepended.
|
|
|
|
*/
|
|
|
|
,configList ? (configuration : [])
|
|
|
|
,aufs ? true
|
2008-05-12 09:12:18 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
Address/netmask to be always added, whatever
|
|
|
|
network-interfaces configure is kept
|
|
|
|
*/
|
|
|
|
,addIP ? ""
|
|
|
|
,netmask ? "255.255.255.0"
|
|
|
|
/* To select interface to bind address to */
|
|
|
|
,ifName ? "eth0"
|
|
|
|
|
|
|
|
/*
|
|
|
|
list of: {source, target}
|
|
|
|
*/
|
|
|
|
,additionalFiles ? []
|
2008-06-06 12:04:27 +02:00
|
|
|
,compressImage ? false
|
2008-09-09 00:36:11 +02:00
|
|
|
,nixpkgsPath ? ../../../nixpkgs
|
2008-06-07 12:52:44 +02:00
|
|
|
,additionalJobs ? []
|
2008-09-09 00:36:11 +02:00
|
|
|
,intel3945FWEnable ? true
|
|
|
|
,intel4965FWEnable ? true
|
2008-08-26 15:58:59 +02:00
|
|
|
,cdLabel ? "NIXOS_INSTALLATION_CD"
|
2008-09-08 23:08:20 +02:00
|
|
|
,relName ?
|
|
|
|
if builtins.pathExists ../../relname
|
|
|
|
then builtins.readFile ../../relname
|
|
|
|
else "nixos-${builtins.readFile ../../VERSION}"
|
2008-09-09 00:36:11 +02:00
|
|
|
,nix ? pkgs: pkgs.nix
|
2008-01-30 10:42:48 +01:00
|
|
|
}:
|
2008-06-06 12:04:27 +02:00
|
|
|
let
|
|
|
|
realLib = if lib != null then lib else (import (nixpkgsPath+"/pkgs/lib"));
|
|
|
|
in
|
2008-01-11 17:59:39 +01:00
|
|
|
let
|
2008-06-06 12:04:27 +02:00
|
|
|
lib = realLib;
|
|
|
|
|
2008-01-30 10:42:48 +01:00
|
|
|
ttyCount = lib.fold builtins.add 0 [
|
|
|
|
(if rogueEnabled then 1 else 0)
|
|
|
|
(if manualEnabled then 1 else 0)
|
|
|
|
];
|
|
|
|
|
|
|
|
systemPackBuilder = {suffix, configuration} :
|
|
|
|
{
|
2008-09-08 23:08:20 +02:00
|
|
|
system = (import ../../system/system.nix) {
|
2008-06-06 12:04:27 +02:00
|
|
|
inherit configuration platform nixpkgsPath; /* To refactor later - x86+x86_64 DVD */
|
2008-01-30 10:42:48 +01:00
|
|
|
};
|
|
|
|
inherit suffix configuration;
|
|
|
|
};
|
|
|
|
|
|
|
|
systemPackGrubEntry = systemPack :
|
|
|
|
(''
|
2008-01-11 17:59:39 +01:00
|
|
|
|
2008-01-30 10:42:48 +01:00
|
|
|
title NixOS Installer / Rescue ${systemPack.system.config.boot.configurationName}
|
|
|
|
kernel /boot/vmlinuz${systemPack.suffix} ${toString systemPack.system.config.boot.kernelParams} systemConfig=/system${systemPack.suffix}
|
|
|
|
initrd /boot/initrd${systemPack.suffix}
|
|
|
|
|
|
|
|
'');
|
|
|
|
|
|
|
|
systemPackInstallRootList = systemPack :
|
|
|
|
[
|
|
|
|
{
|
|
|
|
source = systemPack.system.kernel + "/vmlinuz";
|
|
|
|
target = "boot/vmlinuz${systemPack.suffix}";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
source = systemPack.system.initialRamdisk + "/initrd";
|
|
|
|
target = "boot/initrd${systemPack.suffix}";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
systemPackInstallClosures = systemPack :
|
|
|
|
([
|
|
|
|
{
|
|
|
|
object = systemPack.system.bootStage2;
|
|
|
|
symlink = "/init${systemPack.suffix}";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
object = systemPack.system.system;
|
|
|
|
symlink = "/system${systemPack.suffix}";
|
|
|
|
}
|
|
|
|
]
|
|
|
|
++
|
|
|
|
(lib.optional includeStdenv
|
|
|
|
# To speed up the installation, provide the full stdenv.
|
|
|
|
{
|
|
|
|
object = systemPack.system.pkgs.stdenv;
|
|
|
|
symlink = "none";
|
|
|
|
}
|
|
|
|
)
|
|
|
|
);
|
|
|
|
systemPackInstallBuildClosure = systemPack :
|
|
|
|
([
|
|
|
|
{
|
|
|
|
object = systemPack.system.system.drvPath;
|
|
|
|
symlink = "none";
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
userEntry = user :
|
|
|
|
{
|
|
|
|
name = user;
|
|
|
|
description = "NixOS Live Disk non-root user";
|
|
|
|
home = "/home/${user}";
|
|
|
|
createHome = true;
|
|
|
|
group = "users";
|
|
|
|
extraGroups = ["wheel" "audio"];
|
|
|
|
shell = "/bin/sh";
|
|
|
|
};
|
2008-01-07 19:33:07 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
rec {
|
2008-08-26 15:58:59 +02:00
|
|
|
|
|
|
|
inherit cdLabel;
|
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
nixpkgsRel = "nixpkgs" + (if networkNixpkgs != "" then "-" + networkNixpkgs else "");
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2009-02-24 17:19:29 +01:00
|
|
|
configuration = {pkgs, config, ...}: let preConfiguration ={
|
2008-01-07 19:33:07 +01:00
|
|
|
boot = {
|
2008-01-29 23:37:24 +01:00
|
|
|
isLiveCD = true;
|
2008-01-07 19:33:07 +01:00
|
|
|
# The label used to identify the installation CD.
|
2008-01-30 10:42:48 +01:00
|
|
|
extraTTYs = []
|
|
|
|
++ (lib.optional manualEnabled 7)
|
|
|
|
++ (lib.optional rogueEnabled 8);
|
2008-08-26 15:58:59 +02:00
|
|
|
kernelPackages = kernelPackages pkgs;
|
2008-01-16 22:56:31 +01:00
|
|
|
initrd = {
|
2008-01-30 10:42:48 +01:00
|
|
|
extraKernelModules = extraInitrdKernelModules
|
|
|
|
++ (if aufs then ["aufs"] else [])
|
|
|
|
;
|
2008-01-16 22:56:31 +01:00
|
|
|
};
|
2008-01-19 14:47:49 +01:00
|
|
|
kernelModules = bootKernelModules;
|
2008-08-26 15:58:59 +02:00
|
|
|
extraModulePackages = ((extraModulePackages pkgs)
|
2008-05-23 08:40:16 +02:00
|
|
|
++(if aufs then [(kernelPackages pkgs).aufs] else [])
|
|
|
|
);
|
2008-01-07 19:33:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
|
2008-01-30 10:42:48 +01:00
|
|
|
sshd = { enable = sshdEnabled; };
|
|
|
|
|
|
|
|
xserver = { enable = false; };
|
2008-09-09 00:36:11 +02:00
|
|
|
|
|
|
|
udev = {
|
|
|
|
addFirmware = []
|
2009-02-24 17:19:29 +01:00
|
|
|
#++ (pkgs.lib.optional intel3945FWEnable pkgs.iwlwifi3945ucode)
|
|
|
|
#++ (pkgs.lib.optional intel4965FWEnable pkgs.iwlwifi4965ucode)
|
2008-09-09 00:36:11 +02:00
|
|
|
;
|
|
|
|
};
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
extraJobs = [
|
|
|
|
# Unpack the NixOS/Nixpkgs sources to /etc/nixos.
|
2008-01-30 10:42:48 +01:00
|
|
|
{
|
|
|
|
name = "unpack-sources";
|
|
|
|
job = ''
|
2008-01-07 19:33:07 +01:00
|
|
|
start on startup
|
|
|
|
script
|
2008-01-30 10:42:48 +01:00
|
|
|
export PATH=${pkgs.gnutar}/bin:${pkgs.bzip2}/bin:$PATH
|
2008-02-08 20:31:41 +01:00
|
|
|
|
|
|
|
mkdir -p /mnt
|
2008-01-30 10:42:48 +01:00
|
|
|
|
|
|
|
${system.nix}/bin/nix-store --load-db < /nix-path-registration
|
|
|
|
|
|
|
|
mkdir -p /etc/nixos/nixos
|
|
|
|
tar xjf /install/nixos.tar.bz2 -C /etc/nixos/nixos
|
|
|
|
tar xjf /install/nixpkgs.tar.bz2 -C /etc/nixos
|
2008-05-09 07:58:21 +02:00
|
|
|
tar xjf /install/nixos-services.tar.bz2 -C /etc/nixos
|
2008-01-30 10:42:48 +01:00
|
|
|
mv /etc/nixos/nixpkgs-* /etc/nixos/nixpkgs || true
|
2008-05-09 07:58:21 +02:00
|
|
|
mv /etc/nixos/*-nixpkgs /etc/nixos/nixpkgs || true
|
|
|
|
mv /etc/nixos/*-services /etc/nixos/services || true
|
2008-01-30 10:42:48 +01:00
|
|
|
ln -sfn ../nixpkgs/pkgs /etc/nixos/nixos/pkgs
|
2008-05-09 07:58:21 +02:00
|
|
|
ln -sfn ../services /etc/nixos/services
|
2008-01-30 10:42:48 +01:00
|
|
|
chown -R root.root /etc/nixos
|
|
|
|
touch /etc/resolv.conf
|
2008-01-07 19:33:07 +01:00
|
|
|
end script
|
2008-01-30 10:42:48 +01:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
2008-06-07 12:52:44 +02:00
|
|
|
++ additionalJobs
|
|
|
|
|
2008-01-30 10:42:48 +01:00
|
|
|
++
|
|
|
|
|
|
|
|
(lib.optional manualEnabled
|
2008-01-07 19:33:07 +01:00
|
|
|
# Show the NixOS manual on tty7.
|
2008-01-30 10:42:48 +01:00
|
|
|
{
|
|
|
|
name = "manual";
|
|
|
|
job = ''
|
2008-01-07 19:33:07 +01:00
|
|
|
start on udev
|
|
|
|
stop on shutdown
|
|
|
|
respawn ${pkgs.w3m}/bin/w3m ${manual} < /dev/tty7 > /dev/tty7 2>&1
|
2008-01-30 10:42:48 +01:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
++
|
|
|
|
|
|
|
|
(lib.optional rogueEnabled
|
2008-01-07 19:33:07 +01:00
|
|
|
# Allow the user to do something useful on tty8 while waiting
|
|
|
|
# for the installation to finish.
|
2008-01-30 10:42:48 +01:00
|
|
|
{
|
|
|
|
name = "rogue";
|
|
|
|
job = ''
|
2008-01-07 19:33:07 +01:00
|
|
|
start on udev
|
|
|
|
stop on shutdown
|
|
|
|
respawn ${pkgs.rogue}/bin/rogue < /dev/tty8 > /dev/tty8 2>&1
|
2008-01-30 10:42:48 +01:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
++
|
|
|
|
|
|
|
|
(lib.optional (addUsers != [])
|
|
|
|
# Set empty passwords
|
|
|
|
{
|
|
|
|
name = "clear-passwords";
|
|
|
|
job = ''
|
|
|
|
start on startup
|
|
|
|
script
|
|
|
|
for i in ${lib.concatStringsSep " " addUsers}; do
|
|
|
|
echo | ${pkgs.pwdutils}/bin/passwd --stdin $i
|
|
|
|
done
|
|
|
|
end script
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|
2008-05-12 09:12:18 +02:00
|
|
|
|
|
|
|
++
|
|
|
|
|
|
|
|
(lib.optional (addIP != "")
|
|
|
|
{
|
|
|
|
name = "add-IP-adress";
|
|
|
|
job = ''
|
|
|
|
start on network-interfaces/started
|
|
|
|
script
|
|
|
|
${pkgs.nettools}/sbin/ifconfig ${ifName} add ${addIP} up
|
|
|
|
${pkgs.nettools}/sbin/ifconfig ${ifName}:0 netmask ${netmask} up
|
|
|
|
end script
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|
2008-01-07 19:33:07 +01:00
|
|
|
;
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
# And a background to go with that.
|
|
|
|
ttyBackgrounds = {
|
|
|
|
specificThemes = []
|
2008-01-30 10:42:48 +01:00
|
|
|
++
|
|
|
|
(lib.optional manualEnabled
|
|
|
|
{
|
|
|
|
tty = 7;
|
2008-01-07 19:33:07 +01:00
|
|
|
# Theme is GPL according to http://kde-look.org/content/show.php/Green?content=58501.
|
|
|
|
theme = pkgs.fetchurl {
|
|
|
|
url = http://www.kde-look.org/CONTENT/content-files/58501-green.tar.gz;
|
|
|
|
sha256 = "0sdykpziij1f3w4braq8r8nqg4lnsd7i7gi1k5d7c31m2q3b9a7r";
|
|
|
|
};
|
2008-01-30 10:42:48 +01:00
|
|
|
}
|
|
|
|
)
|
|
|
|
++
|
|
|
|
(lib.optional rogueEnabled
|
|
|
|
{
|
|
|
|
tty = 8;
|
2008-01-07 19:33:07 +01:00
|
|
|
theme = pkgs.fetchurl {
|
|
|
|
url = http://www.bootsplash.de/files/themes/Theme-GNU.tar.bz2;
|
|
|
|
md5 = "61969309d23c631e57b0a311102ef034";
|
|
|
|
};
|
2008-01-30 10:42:48 +01:00
|
|
|
}
|
|
|
|
)
|
2008-01-07 19:33:07 +01:00
|
|
|
;
|
|
|
|
};
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
mingetty = {
|
2008-01-30 10:42:48 +01:00
|
|
|
helpLine = ''
|
2008-01-07 19:33:07 +01:00
|
|
|
Log in as "root" with an empty password.
|
2008-01-11 17:59:39 +01:00
|
|
|
''
|
2008-01-30 10:42:48 +01:00
|
|
|
+(if addUsers != [] then
|
|
|
|
'' These users also have empty passwords:
|
|
|
|
${lib.concatStringsSep " " addUsers }
|
|
|
|
''
|
|
|
|
else "")
|
|
|
|
+(if manualEnabled then " Press <Alt-F7> for help." else "");
|
2008-01-07 19:33:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
2008-01-30 10:42:48 +01:00
|
|
|
|
|
|
|
fonts = { enableFontConfig = fontConfigEnabled; };
|
2008-01-07 19:33:07 +01:00
|
|
|
|
|
|
|
installer = {
|
|
|
|
nixpkgsURL =
|
2008-01-30 10:42:48 +01:00
|
|
|
(if networkNixpkgs != "" then http://nix.cs.uu.nl/dist/nix/ + nixpkgsRel
|
|
|
|
else file:///mnt/ );
|
2008-01-07 19:33:07 +01:00
|
|
|
};
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
security = {
|
2008-01-30 10:42:48 +01:00
|
|
|
sudo = { enable = sudoEnable; };
|
2008-01-07 19:33:07 +01:00
|
|
|
};
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
environment = {
|
2008-08-26 15:58:59 +02:00
|
|
|
extraPackages = if cleanStart then [] else [
|
2008-01-07 19:33:07 +01:00
|
|
|
pkgs.vim
|
|
|
|
pkgs.subversion # for nixos-checkout
|
|
|
|
pkgs.w3m # needed for the manual anyway
|
2008-01-09 15:33:41 +01:00
|
|
|
] ++ (packages pkgs);
|
2008-01-16 22:56:31 +01:00
|
|
|
checkConfigurationOptions = true;
|
2008-01-22 18:55:57 +01:00
|
|
|
cleanStart = cleanStart;
|
2008-09-09 00:36:11 +02:00
|
|
|
nix = nix pkgs;
|
2008-01-07 19:33:07 +01:00
|
|
|
};
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-11 17:59:39 +01:00
|
|
|
users = {
|
|
|
|
extraUsers = map userEntry addUsers;
|
|
|
|
};
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-08-26 15:58:59 +02:00
|
|
|
fileSystems = [
|
|
|
|
{ mountPoint = "/";
|
|
|
|
label = cdLabel;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2008-01-22 18:55:57 +01:00
|
|
|
}; in preConfiguration // (arbitraryOverrides preConfiguration);
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-11 17:59:39 +01:00
|
|
|
configurations = [{
|
|
|
|
inherit configuration;
|
|
|
|
suffix = "";
|
|
|
|
}] ++ (configList configuration);
|
|
|
|
systemPacks = map systemPackBuilder configurations;
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-11 17:59:39 +01:00
|
|
|
system = (builtins.head systemPacks).system; /* I hope this is unneeded */
|
|
|
|
pkgs = system.pkgs; /* Nothing non-fixed should be built from it */
|
2008-01-30 10:42:48 +01:00
|
|
|
|
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
# The NixOS manual, with a backward compatibility hack for Nix <=
|
|
|
|
# 0.11 (you won't get the manual).
|
2008-01-30 10:42:48 +01:00
|
|
|
manual = if builtins ? unsafeDiscardStringContext
|
2008-09-08 23:08:20 +02:00
|
|
|
then "${import ../../doc/manual {inherit nixpkgsPath;}}/manual.html"
|
2008-01-07 19:33:07 +01:00
|
|
|
else pkgs.writeText "dummy-manual" "Manual not included in this build!";
|
2008-01-30 10:42:48 +01:00
|
|
|
|
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
# We need a copy of the Nix expressions for Nixpkgs and NixOS on the
|
2008-01-30 10:42:48 +01:00
|
|
|
# CD. We put them in a tarball because accessing that many small
|
2008-01-07 19:33:07 +01:00
|
|
|
# files from a slow device like a CD-ROM takes too long.
|
2008-01-30 10:42:48 +01:00
|
|
|
makeTarball = tarName: input: pkgs.runCommand "tarball" {inherit tarName;} ''
|
2008-01-07 19:33:07 +01:00
|
|
|
ensureDir $out
|
2008-01-30 10:42:48 +01:00
|
|
|
(cd ${input} && tar cvfj $out/${tarName} . \
|
|
|
|
--exclude '*~' \
|
|
|
|
--exclude 'pkgs' --exclude 'result')
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeNixPkgsTarball = tarName: input: ((pkgs.runCommand "tarball-nixpkgs" {inherit tarName;} ''
|
|
|
|
ensureDir $out
|
2008-05-09 07:58:21 +02:00
|
|
|
(cd ${input}/.. && tar cvfj $out/${tarName} $(basename ${input}) \
|
2008-01-30 10:42:48 +01:00
|
|
|
--exclude '*~' \
|
|
|
|
--exclude 'result')
|
|
|
|
'')+"/${tarName}");
|
|
|
|
|
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
|
|
|
|
# Put the current directory in a tarball (making sure to filter
|
|
|
|
# out crap like the .svn directories).
|
|
|
|
nixosTarball =
|
|
|
|
let filter = name: type:
|
2008-01-30 10:42:48 +01:00
|
|
|
let base = baseNameOf (toString name);
|
|
|
|
in base != ".svn" && base != "result";
|
2008-01-07 19:33:07 +01:00
|
|
|
in
|
2008-09-08 23:08:20 +02:00
|
|
|
makeTarball "nixos.tar.bz2" (builtins.filterSource filter ./../..);
|
2008-01-30 10:42:48 +01:00
|
|
|
|
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
# Get a recent copy of Nixpkgs.
|
2008-01-30 10:42:48 +01:00
|
|
|
nixpkgsTarball = if networkNixpkgs != "" then pkgs.fetchurl {
|
2008-01-07 19:33:07 +01:00
|
|
|
url = configuration.installer.nixpkgsURL + "/" + nixpkgsRel + ".tar.bz2";
|
|
|
|
md5 = "6a793b877e2a4fa79827515902e1dfd8";
|
2008-06-06 12:04:27 +02:00
|
|
|
} else makeNixPkgsTarball "nixpkgs.tar.bz2" ("" + nixpkgsPath);
|
2008-05-09 07:58:21 +02:00
|
|
|
|
2008-09-08 23:08:20 +02:00
|
|
|
nixosServicesTarball = makeNixPkgsTarball "nixos-services.tar.bz2" ("" + ./../../../services);
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
# The configuration file for Grub.
|
2008-01-09 15:33:41 +01:00
|
|
|
grubCfg = pkgs.writeText "menu.lst" (''
|
2008-01-07 19:33:07 +01:00
|
|
|
default 0
|
|
|
|
timeout 10
|
|
|
|
splashimage /boot/background.xpm.gz
|
2008-01-11 17:59:39 +01:00
|
|
|
''+
|
|
|
|
(lib.concatStrings (map systemPackGrubEntry systemPacks))
|
2008-01-07 19:33:07 +01:00
|
|
|
+ (if includeMemtest then
|
|
|
|
''
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
title Memtest86+
|
2008-01-30 10:42:48 +01:00
|
|
|
kernel /boot/memtest.bin
|
2008-01-09 15:33:41 +01:00
|
|
|
'' else ""));
|
2008-01-30 10:42:48 +01:00
|
|
|
|
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
# Create an ISO image containing the Grub boot loader, the kernel,
|
|
|
|
# the initrd produced above, and the closure of the stage 2 init.
|
2008-09-08 23:08:20 +02:00
|
|
|
rescueCD = import ../../helpers/make-iso9660-image.nix {
|
2008-01-07 19:33:07 +01:00
|
|
|
inherit (pkgs) stdenv perl cdrkit;
|
2008-06-06 12:04:27 +02:00
|
|
|
inherit compressImage nixpkgsPath;
|
2008-09-08 23:08:20 +02:00
|
|
|
isoName = "nixos-${relName}-${platform}.iso";
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
# Single files to be copied to fixed locations on the CD.
|
2008-01-30 10:42:48 +01:00
|
|
|
contents = lib.uniqList {
|
|
|
|
inputList = [
|
|
|
|
{
|
2008-08-15 17:03:50 +02:00
|
|
|
source =
|
|
|
|
"${pkgs.grub}/lib/grub/${if platform == "i686-linux" then "i386-pc" else "x86_64-unknown"}/stage2_eltorito";
|
2008-01-30 10:42:48 +01:00
|
|
|
target = "boot/grub/stage2_eltorito";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
source = grubCfg;
|
|
|
|
target = "boot/grub/menu.lst";
|
|
|
|
}
|
|
|
|
]
|
2008-01-11 17:59:39 +01:00
|
|
|
++
|
|
|
|
(lib.concatLists (map systemPackInstallRootList systemPacks))
|
|
|
|
++
|
2008-01-30 10:42:48 +01:00
|
|
|
[
|
|
|
|
{
|
|
|
|
source = system.config.boot.grubSplashImage;
|
|
|
|
target = "boot/background.xpm.gz";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
source = nixosTarball + "/" + nixosTarball.tarName;
|
|
|
|
target = "/install/" + nixosTarball.tarName;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
source = nixpkgsTarball;
|
|
|
|
target = "/install/nixpkgs.tar.bz2";
|
|
|
|
}
|
2008-05-09 07:58:21 +02:00
|
|
|
{
|
|
|
|
source = nixosServicesTarball;
|
|
|
|
target = "/install/nixos-services.tar.bz2";
|
|
|
|
}
|
2008-01-30 10:42:48 +01:00
|
|
|
]
|
|
|
|
++
|
|
|
|
(lib.optional includeMemtest
|
|
|
|
{
|
|
|
|
source = pkgs.memtest86 + "/memtest.bin";
|
|
|
|
target = "boot/memtest.bin";
|
|
|
|
}
|
|
|
|
)
|
2008-05-12 09:12:18 +02:00
|
|
|
++
|
|
|
|
additionalFiles
|
2008-01-30 10:42:48 +01:00
|
|
|
;
|
|
|
|
};
|
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
# Closures to be copied to the Nix store on the CD.
|
2009-03-18 19:10:38 +01:00
|
|
|
storeContents =
|
|
|
|
lib.uniqListExt {
|
|
|
|
inputList = lib.concatLists
|
|
|
|
(map systemPackInstallClosures systemPacks);
|
|
|
|
getter = x: x.object.drvPath;
|
|
|
|
compare = lib.eqStrings;
|
|
|
|
}
|
|
|
|
++ lib.uniqList {
|
|
|
|
inputList = lib.optionals includeBuildDeps
|
|
|
|
(lib.concatLists (map systemPackInstallBuildClosure systemPacks));
|
|
|
|
};
|
2008-01-07 19:33:07 +01:00
|
|
|
|
|
|
|
bootable = true;
|
|
|
|
bootImage = "boot/grub/stage2_eltorito";
|
2008-08-08 19:13:46 +02:00
|
|
|
|
2008-08-26 15:58:59 +02:00
|
|
|
volumeID = cdLabel;
|
2008-01-07 19:33:07 +01:00
|
|
|
};
|
2008-01-30 10:42:48 +01:00
|
|
|
|
2008-01-07 19:33:07 +01:00
|
|
|
}
|