mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Reformatted rescue-cd-configurable.nix
svn path=/nixos/trunk/; revision=10401
This commit is contained in:
parent
9fd5d70968
commit
b8cc335fbb
1 changed files with 286 additions and 265 deletions
|
@ -1,121 +1,123 @@
|
||||||
/*
|
{
|
||||||
platform ? __currentSystem
|
lib
|
||||||
lib
|
,platform ? __currentSystem
|
||||||
*/
|
,networkNixpkgs ? ""
|
||||||
args: with args;
|
,nixpkgsMd5 ? ""
|
||||||
|
,manualEnabled ? true
|
||||||
|
,rogueEnabled ? true
|
||||||
|
,sshdEnabled ? false
|
||||||
|
,fontConfigEnabled ? false
|
||||||
|
,sudoEnable ? false
|
||||||
|
,packages ? (pkgs : [])
|
||||||
|
,includeMemtest ? true
|
||||||
|
,includeStdenv ? true
|
||||||
|
,includeBuildDeps ? false
|
||||||
|
,kernel ? (pkgs : pkgs.kernel)
|
||||||
|
,addUsers ? []
|
||||||
|
,extraInitrdKernelModules ? []
|
||||||
|
,bootKernelModules ? []
|
||||||
|
,arbitraryOverrides ? (config:{})
|
||||||
|
,cleanStart ? false
|
||||||
|
|
||||||
|
/* Should return list of {configuration, suffix} attrsets.
|
||||||
|
{configuration=configuration; suffix=""} is always prepended.
|
||||||
|
*/
|
||||||
|
,configList ? (configuration : [])
|
||||||
|
,aufs ? true
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
arg = name: def: lib.getAttr [name] def args;
|
ttyCount = lib.fold builtins.add 0 [
|
||||||
platform = arg "platform" __currentSystem;
|
(if rogueEnabled then 1 else 0)
|
||||||
networkNixpkgs = arg "networkNixpkgs" "";
|
(if manualEnabled then 1 else 0)
|
||||||
nixpkgsMd5 = arg "nixpkgsMd5" "";
|
];
|
||||||
manualEnabled = arg "manualEnabled" true;
|
|
||||||
rogueEnabled = arg "rogueEnabled" true;
|
systemPackBuilder = {suffix, configuration} :
|
||||||
ttyCount = lib.fold builtins.add 0 [
|
{
|
||||||
(if rogueEnabled then 1 else 0)
|
system = (import ../system/system.nix) {
|
||||||
(if manualEnabled then 1 else 0)
|
inherit configuration platform; /* To refactor later - x86+x86_64 DVD */
|
||||||
];
|
stage2Init = "/init"+suffix;
|
||||||
sshdEnabled = arg "sshdEnabled" false;
|
};
|
||||||
fontConfigEnabled = arg "fontConfigEnabled" false;
|
inherit suffix configuration;
|
||||||
sudoEnable = arg "sudoEnable" false;
|
};
|
||||||
packages = arg "packages" (pkgs : []);
|
|
||||||
includeMemtest = arg "includeMemtest" true;
|
systemPackGrubEntry = systemPack :
|
||||||
includeStdenv = arg "includeStdenv" true;
|
(''
|
||||||
includeBuildDeps = arg "includeBuildDeps" false;
|
|
||||||
kernel = arg "kernel" (pkgs : pkgs.kernel);
|
|
||||||
addUsers = arg "addUsers" [];
|
|
||||||
extraInitrdKernelModules = arg "extraInitrdKernelModules" [];
|
|
||||||
bootKernelModules = arg "bootKernelModules" [];
|
|
||||||
arbitraryOverrides = arg "arbitraryOverrides" (config:{});
|
|
||||||
cleanStart = arg "cleanStart" false;
|
|
||||||
|
|
||||||
/* Should return list of {configuration, suffix} attrsets.
|
title NixOS Installer / Rescue ${systemPack.system.config.boot.configurationName}
|
||||||
{configuration=configuration; suffix=""} is always prepended.
|
kernel /boot/vmlinuz${systemPack.suffix} ${toString systemPack.system.config.boot.kernelParams} systemConfig=/system${systemPack.suffix}
|
||||||
*/
|
initrd /boot/initrd${systemPack.suffix}
|
||||||
configList = arg "configList" (configuration : []);
|
|
||||||
aufs = arg "aufs" true;
|
'');
|
||||||
in
|
|
||||||
let
|
systemPackInstallRootList = systemPack :
|
||||||
|
[
|
||||||
systemPackBuilder = {suffix, configuration} : {
|
{
|
||||||
system = (import ../system/system.nix) {
|
source = systemPack.system.kernel + "/vmlinuz";
|
||||||
inherit configuration platform; /* To refactor later - x86+x86_64 DVD */
|
target = "boot/vmlinuz${systemPack.suffix}";
|
||||||
stage2Init = "/init"+suffix;
|
}
|
||||||
};
|
{
|
||||||
inherit suffix configuration;
|
source = systemPack.system.initialRamdisk + "/initrd";
|
||||||
};
|
target = "boot/initrd${systemPack.suffix}";
|
||||||
|
}
|
||||||
systemPackGrubEntry = systemPack : (''
|
];
|
||||||
|
systemPackInstallClosures = systemPack :
|
||||||
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}
|
object = systemPack.system.bootStage2;
|
||||||
|
symlink = "/init${systemPack.suffix}";
|
||||||
'');
|
}
|
||||||
|
{
|
||||||
systemPackInstallRootList = systemPack : [
|
object = systemPack.system.system;
|
||||||
{ source = systemPack.system.kernel + "/vmlinuz";
|
symlink = "/system${systemPack.suffix}";
|
||||||
target = "boot/vmlinuz${systemPack.suffix}";
|
}
|
||||||
}
|
]
|
||||||
{ source = systemPack.system.initialRamdisk + "/initrd";
|
++
|
||||||
target = "boot/initrd${systemPack.suffix}";
|
(lib.optional includeStdenv
|
||||||
}
|
# To speed up the installation, provide the full stdenv.
|
||||||
];
|
{
|
||||||
systemPackInstallClosures = systemPack : ([
|
object = systemPack.system.pkgs.stdenv;
|
||||||
{ object = systemPack.system.bootStage2;
|
symlink = "none";
|
||||||
symlink = "/init${systemPack.suffix}";
|
}
|
||||||
}
|
)
|
||||||
{ object = systemPack.system.system;
|
);
|
||||||
symlink = "/system${systemPack.suffix}";
|
systemPackInstallBuildClosure = systemPack :
|
||||||
}
|
([
|
||||||
]
|
{
|
||||||
++
|
object = systemPack.system.system.drvPath;
|
||||||
(lib.optional includeStdenv
|
symlink = "none";
|
||||||
# To speed up the installation, provide the full stdenv.
|
}
|
||||||
{ object = systemPack.system.pkgs.stdenv;
|
]);
|
||||||
symlink = "none";
|
|
||||||
}
|
|
||||||
)
|
userEntry = user :
|
||||||
);
|
{
|
||||||
systemPackInstallBuildClosure = systemPack : ([
|
name = user;
|
||||||
{
|
description = "NixOS Live Disk non-root user";
|
||||||
object = systemPack.system.system.drvPath;
|
home = "/home/${user}";
|
||||||
symlink = "none";
|
createHome = true;
|
||||||
}
|
group = "users";
|
||||||
]);
|
extraGroups = ["wheel" "audio"];
|
||||||
|
shell = "/bin/sh";
|
||||||
|
};
|
||||||
userEntry = user : {
|
|
||||||
name = user;
|
|
||||||
description = "NixOS Live Disk non-root user";
|
|
||||||
home = "/home/${user}";
|
|
||||||
createHome = true;
|
|
||||||
group = "users";
|
|
||||||
extraGroups = ["wheel" "audio"];
|
|
||||||
shell = "/bin/sh";
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
|
||||||
|
|
||||||
nixpkgsRel = "nixpkgs" + (if networkNixpkgs != "" then "-" + networkNixpkgs else "");
|
nixpkgsRel = "nixpkgs" + (if networkNixpkgs != "" then "-" + networkNixpkgs else "");
|
||||||
|
|
||||||
|
|
||||||
configuration = let preConfiguration ={
|
configuration = let preConfiguration ={
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
isLiveCD = true;
|
isLiveCD = true;
|
||||||
autoDetectRootDevice = true;
|
autoDetectRootDevice = true;
|
||||||
# The label used to identify the installation CD.
|
# The label used to identify the installation CD.
|
||||||
rootLabel = "NIXOS";
|
rootLabel = "NIXOS";
|
||||||
extraTTYs = [] ++ (lib.optional manualEnabled 7) ++
|
extraTTYs = []
|
||||||
(lib.optional rogueEnabled 8);
|
++ (lib.optional manualEnabled 7)
|
||||||
|
++ (lib.optional rogueEnabled 8);
|
||||||
inherit kernel;
|
inherit kernel;
|
||||||
initrd = {
|
initrd = {
|
||||||
extraKernelModules = extraInitrdKernelModules
|
extraKernelModules = extraInitrdKernelModules
|
||||||
++ (if aufs then ["aufs"] else [])
|
++ (if aufs then ["aufs"] else [])
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
kernelModules = bootKernelModules;
|
kernelModules = bootKernelModules;
|
||||||
extraModulePackages = []
|
extraModulePackages = []
|
||||||
|
@ -124,127 +126,134 @@ rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|
||||||
sshd = {
|
|
||||||
enable = sshdEnabled;
|
|
||||||
};
|
|
||||||
|
|
||||||
xserver = {
|
sshd = { enable = sshdEnabled; };
|
||||||
enable = false;
|
|
||||||
};
|
xserver = { enable = false; };
|
||||||
|
|
||||||
extraJobs = [
|
extraJobs = [
|
||||||
# Unpack the NixOS/Nixpkgs sources to /etc/nixos.
|
# Unpack the NixOS/Nixpkgs sources to /etc/nixos.
|
||||||
{ name = "unpack-sources";
|
{
|
||||||
job = "
|
name = "unpack-sources";
|
||||||
|
job = ''
|
||||||
start on startup
|
start on startup
|
||||||
script
|
script
|
||||||
export PATH=${pkgs.gnutar}/bin:${pkgs.bzip2}/bin:$PATH
|
export PATH=${pkgs.gnutar}/bin:${pkgs.bzip2}/bin:$PATH
|
||||||
mkdir -p /etc/nixos/nixos
|
|
||||||
tar xjf /nixos.tar.bz2 -C /etc/nixos/nixos
|
${system.nix}/bin/nix-store --load-db < /nix-path-registration
|
||||||
tar xjf /nixpkgs.tar.bz2 -C /etc/nixos
|
|
||||||
mv /etc/nixos/nixpkgs-* /etc/nixos/nixpkgs || true
|
mkdir -p /etc/nixos/nixos
|
||||||
ln -sfn ../nixpkgs/pkgs /etc/nixos/nixos/pkgs
|
tar xjf /install/nixos.tar.bz2 -C /etc/nixos/nixos
|
||||||
chown -R root.root /etc/nixos
|
tar xjf /install/nixpkgs.tar.bz2 -C /etc/nixos
|
||||||
touch /etc/resolv.conf
|
mv /etc/nixos/nixpkgs-* /etc/nixos/nixpkgs || true
|
||||||
|
ln -sfn ../nixpkgs/pkgs /etc/nixos/nixos/pkgs
|
||||||
|
chown -R root.root /etc/nixos
|
||||||
|
touch /etc/resolv.conf
|
||||||
end script
|
end script
|
||||||
";
|
'';
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
++
|
|
||||||
|
++
|
||||||
(lib.optional manualEnabled
|
|
||||||
|
(lib.optional manualEnabled
|
||||||
# Show the NixOS manual on tty7.
|
# Show the NixOS manual on tty7.
|
||||||
{ name = "manual";
|
{
|
||||||
job = "
|
name = "manual";
|
||||||
|
job = ''
|
||||||
start on udev
|
start on udev
|
||||||
stop on shutdown
|
stop on shutdown
|
||||||
respawn ${pkgs.w3m}/bin/w3m ${manual} < /dev/tty7 > /dev/tty7 2>&1
|
respawn ${pkgs.w3m}/bin/w3m ${manual} < /dev/tty7 > /dev/tty7 2>&1
|
||||||
";
|
'';
|
||||||
})
|
}
|
||||||
|
)
|
||||||
++
|
|
||||||
|
++
|
||||||
(lib.optional rogueEnabled
|
|
||||||
|
(lib.optional rogueEnabled
|
||||||
# Allow the user to do something useful on tty8 while waiting
|
# Allow the user to do something useful on tty8 while waiting
|
||||||
# for the installation to finish.
|
# for the installation to finish.
|
||||||
{ name = "rogue";
|
{
|
||||||
job = "
|
name = "rogue";
|
||||||
|
job = ''
|
||||||
start on udev
|
start on udev
|
||||||
stop on shutdown
|
stop on shutdown
|
||||||
respawn ${pkgs.rogue}/bin/rogue < /dev/tty8 > /dev/tty8 2>&1
|
respawn ${pkgs.rogue}/bin/rogue < /dev/tty8 > /dev/tty8 2>&1
|
||||||
";
|
'';
|
||||||
})
|
}
|
||||||
|
)
|
||||||
++
|
|
||||||
|
++
|
||||||
(lib.optional (addUsers != [])
|
|
||||||
# Set empty passwords
|
(lib.optional (addUsers != [])
|
||||||
{
|
# Set empty passwords
|
||||||
name = "clear-passwords";
|
{
|
||||||
job = ''
|
name = "clear-passwords";
|
||||||
start on startup
|
job = ''
|
||||||
script
|
start on startup
|
||||||
for i in ${lib.concatStringsSep " " addUsers}; do
|
script
|
||||||
echo | ${pkgs.pwdutils}/bin/passwd --stdin $i
|
for i in ${lib.concatStringsSep " " addUsers}; do
|
||||||
done
|
echo | ${pkgs.pwdutils}/bin/passwd --stdin $i
|
||||||
end script
|
done
|
||||||
'';
|
end script
|
||||||
})
|
'';
|
||||||
|
}
|
||||||
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
# And a background to go with that.
|
# And a background to go with that.
|
||||||
ttyBackgrounds = {
|
ttyBackgrounds = {
|
||||||
specificThemes = []
|
specificThemes = []
|
||||||
++
|
++
|
||||||
(lib.optional manualEnabled
|
(lib.optional manualEnabled
|
||||||
{ tty = 7;
|
{
|
||||||
|
tty = 7;
|
||||||
# Theme is GPL according to http://kde-look.org/content/show.php/Green?content=58501.
|
# Theme is GPL according to http://kde-look.org/content/show.php/Green?content=58501.
|
||||||
theme = pkgs.fetchurl {
|
theme = pkgs.fetchurl {
|
||||||
url = http://www.kde-look.org/CONTENT/content-files/58501-green.tar.gz;
|
url = http://www.kde-look.org/CONTENT/content-files/58501-green.tar.gz;
|
||||||
sha256 = "0sdykpziij1f3w4braq8r8nqg4lnsd7i7gi1k5d7c31m2q3b9a7r";
|
sha256 = "0sdykpziij1f3w4braq8r8nqg4lnsd7i7gi1k5d7c31m2q3b9a7r";
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
++
|
)
|
||||||
(lib.optional rogueEnabled
|
++
|
||||||
{ tty = 8;
|
(lib.optional rogueEnabled
|
||||||
|
{
|
||||||
|
tty = 8;
|
||||||
theme = pkgs.fetchurl {
|
theme = pkgs.fetchurl {
|
||||||
url = http://www.bootsplash.de/files/themes/Theme-GNU.tar.bz2;
|
url = http://www.bootsplash.de/files/themes/Theme-GNU.tar.bz2;
|
||||||
md5 = "61969309d23c631e57b0a311102ef034";
|
md5 = "61969309d23c631e57b0a311102ef034";
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
)
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
mingetty = {
|
mingetty = {
|
||||||
helpLine = ''
|
helpLine = ''
|
||||||
|
|
||||||
Log in as "root" with an empty password.
|
Log in as "root" with an empty password.
|
||||||
''
|
''
|
||||||
+(if addUsers != [] then '' These users also have empty passwords:
|
+(if addUsers != [] then
|
||||||
${lib.concatStringsSep " " addUsers }
|
'' These users also have empty passwords:
|
||||||
'' else "")
|
${lib.concatStringsSep " " addUsers }
|
||||||
+(if manualEnabled then " Press <Alt-F7> for help." else "");
|
''
|
||||||
|
else "")
|
||||||
|
+(if manualEnabled then " Press <Alt-F7> for help." else "");
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fonts = {
|
fonts = { enableFontConfig = fontConfigEnabled; };
|
||||||
enableFontConfig = fontConfigEnabled;
|
|
||||||
};
|
|
||||||
|
|
||||||
installer = {
|
installer = {
|
||||||
nixpkgsURL =
|
nixpkgsURL =
|
||||||
(if networkNixpkgs != "" then http://nix.cs.uu.nl/dist/nix/ + nixpkgsRel
|
(if networkNixpkgs != "" then http://nix.cs.uu.nl/dist/nix/ + nixpkgsRel
|
||||||
else file:///mnt/ );
|
else file:///mnt/ );
|
||||||
};
|
};
|
||||||
|
|
||||||
security = {
|
security = {
|
||||||
sudo = {
|
sudo = { enable = sudoEnable; };
|
||||||
enable = sudoEnable;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
extraPackages = if cleanStart then pkgs:[] else pkgs: [
|
extraPackages = if cleanStart then pkgs:[] else pkgs: [
|
||||||
pkgs.vim
|
pkgs.vim
|
||||||
|
@ -254,76 +263,75 @@ rec {
|
||||||
checkConfigurationOptions = true;
|
checkConfigurationOptions = true;
|
||||||
cleanStart = cleanStart;
|
cleanStart = cleanStart;
|
||||||
};
|
};
|
||||||
|
|
||||||
users = {
|
users = {
|
||||||
extraUsers = map userEntry addUsers;
|
extraUsers = map userEntry addUsers;
|
||||||
};
|
};
|
||||||
|
|
||||||
}; in preConfiguration // (arbitraryOverrides preConfiguration);
|
}; in preConfiguration // (arbitraryOverrides preConfiguration);
|
||||||
|
|
||||||
configurations = [{
|
configurations = [{
|
||||||
inherit configuration;
|
inherit configuration;
|
||||||
suffix = "";
|
suffix = "";
|
||||||
}] ++ (configList configuration);
|
}] ++ (configList configuration);
|
||||||
systemPacks = map systemPackBuilder configurations;
|
systemPacks = map systemPackBuilder configurations;
|
||||||
|
|
||||||
system = (builtins.head systemPacks).system; /* I hope this is unneeded */
|
system = (builtins.head systemPacks).system; /* I hope this is unneeded */
|
||||||
pkgs = system.pkgs; /* Nothing non-fixed should be built from it */
|
pkgs = system.pkgs; /* Nothing non-fixed should be built from it */
|
||||||
|
|
||||||
|
|
||||||
# The NixOS manual, with a backward compatibility hack for Nix <=
|
# The NixOS manual, with a backward compatibility hack for Nix <=
|
||||||
# 0.11 (you won't get the manual).
|
# 0.11 (you won't get the manual).
|
||||||
manual =
|
manual = if builtins ? unsafeDiscardStringContext
|
||||||
if builtins ? unsafeDiscardStringContext
|
|
||||||
then "${import ../doc/manual}/manual.html"
|
then "${import ../doc/manual}/manual.html"
|
||||||
else pkgs.writeText "dummy-manual" "Manual not included in this build!";
|
else pkgs.writeText "dummy-manual" "Manual not included in this build!";
|
||||||
|
|
||||||
|
|
||||||
# Since the CD is read-only, the mount points must be on disk.
|
# Since the CD is read-only, the mount points must be on disk.
|
||||||
cdMountPoints = pkgs.runCommand "mount-points" {} "
|
cdMountPoints = pkgs.runCommand "mount-points" {} ''
|
||||||
ensureDir $out
|
ensureDir $out
|
||||||
cd $out
|
cd $out
|
||||||
mkdir proc sys tmp etc dev var mnt nix nix/var root bin ${if addUsers != "" then "home" else ""}
|
mkdir proc sys tmp etc dev var mnt nix nix/var root bin ${if addUsers != "" then "home" else ""}
|
||||||
touch $out/${configuration.boot.rootLabel}
|
touch $out/${configuration.boot.rootLabel}
|
||||||
";
|
'';
|
||||||
|
|
||||||
|
|
||||||
# We need a copy of the Nix expressions for Nixpkgs and NixOS on the
|
# 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
|
# CD. We put them in a tarball because accessing that many small
|
||||||
# files from a slow device like a CD-ROM takes too long.
|
# files from a slow device like a CD-ROM takes too long.
|
||||||
makeTarball = tarName: input: pkgs.runCommand "tarball" {inherit tarName;} "
|
makeTarball = tarName: input: pkgs.runCommand "tarball" {inherit tarName;} ''
|
||||||
ensureDir $out
|
ensureDir $out
|
||||||
(cd ${input} && tar cvfj $out/${tarName} . \\
|
(cd ${input} && tar cvfj $out/${tarName} . \
|
||||||
--exclude '*~' \\
|
--exclude '*~' \
|
||||||
--exclude 'pkgs' --exclude 'result')
|
--exclude 'pkgs' --exclude 'result')
|
||||||
";
|
'';
|
||||||
|
|
||||||
makeNixPkgsTarball = tarName: input: ((pkgs.runCommand "tarball-nixpkgs" {inherit tarName;} "
|
makeNixPkgsTarball = tarName: input: ((pkgs.runCommand "tarball-nixpkgs" {inherit tarName;} ''
|
||||||
ensureDir $out
|
ensureDir $out
|
||||||
(cd ${input}/.. && tar cvfj $out/${tarName} nixpkgs \\
|
(cd ${input}/.. && tar cvfj $out/${tarName} nixpkgs \
|
||||||
--exclude '*~' \\
|
--exclude '*~' \
|
||||||
--exclude 'result')
|
--exclude 'result')
|
||||||
")+"/${tarName}");
|
'')+"/${tarName}");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Put the current directory in a tarball (making sure to filter
|
# Put the current directory in a tarball (making sure to filter
|
||||||
# out crap like the .svn directories).
|
# out crap like the .svn directories).
|
||||||
nixosTarball =
|
nixosTarball =
|
||||||
let filter = name: type:
|
let filter = name: type:
|
||||||
let base = baseNameOf (toString name);
|
let base = baseNameOf (toString name);
|
||||||
in base != ".svn" && base != "result";
|
in base != ".svn" && base != "result";
|
||||||
in
|
in
|
||||||
makeTarball "nixos.tar.bz2" (builtins.filterSource filter ./..);
|
makeTarball "nixos.tar.bz2" (builtins.filterSource filter ./..);
|
||||||
|
|
||||||
|
|
||||||
# Get a recent copy of Nixpkgs.
|
# Get a recent copy of Nixpkgs.
|
||||||
nixpkgsTarball = if networkNixpkgs != "" then pkgs.fetchurl {
|
nixpkgsTarball = if networkNixpkgs != "" then pkgs.fetchurl {
|
||||||
url = configuration.installer.nixpkgsURL + "/" + nixpkgsRel + ".tar.bz2";
|
url = configuration.installer.nixpkgsURL + "/" + nixpkgsRel + ".tar.bz2";
|
||||||
md5 = "6a793b877e2a4fa79827515902e1dfd8";
|
md5 = "6a793b877e2a4fa79827515902e1dfd8";
|
||||||
} else makeNixPkgsTarball "nixpkgs.tar.bz2" "/etc/nixos/nixpkgs";
|
} else makeNixPkgsTarball "nixpkgs.tar.bz2" "/etc/nixos/nixpkgs";
|
||||||
|
|
||||||
|
|
||||||
# The configuration file for Grub.
|
# The configuration file for Grub.
|
||||||
grubCfg = pkgs.writeText "menu.lst" (''
|
grubCfg = pkgs.writeText "menu.lst" (''
|
||||||
default 0
|
default 0
|
||||||
|
@ -333,68 +341,81 @@ rec {
|
||||||
(lib.concatStrings (map systemPackGrubEntry systemPacks))
|
(lib.concatStrings (map systemPackGrubEntry systemPacks))
|
||||||
+ (if includeMemtest then
|
+ (if includeMemtest then
|
||||||
''
|
''
|
||||||
|
|
||||||
title Memtest86+
|
title Memtest86+
|
||||||
kernel /boot/memtest.bin
|
kernel /boot/memtest.bin
|
||||||
'' else ""));
|
'' else ""));
|
||||||
|
|
||||||
|
|
||||||
# Create an ISO image containing the Grub boot loader, the kernel,
|
# Create an ISO image containing the Grub boot loader, the kernel,
|
||||||
# the initrd produced above, and the closure of the stage 2 init.
|
# the initrd produced above, and the closure of the stage 2 init.
|
||||||
rescueCD = import ../helpers/make-iso9660-image.nix {
|
rescueCD = import ../helpers/make-iso9660-image.nix {
|
||||||
inherit (pkgs) stdenv perl cdrkit;
|
inherit (pkgs) stdenv perl cdrkit;
|
||||||
isoName = "nixos-${platform}.iso";
|
isoName = "nixos-${platform}.iso";
|
||||||
|
|
||||||
# Single files to be copied to fixed locations on the CD.
|
# Single files to be copied to fixed locations on the CD.
|
||||||
contents = lib.uniqList {inputList =
|
contents = lib.uniqList {
|
||||||
[
|
inputList = [
|
||||||
{ source = "${pkgs.grub}/lib/grub/i386-pc/stage2_eltorito";
|
{
|
||||||
target = "boot/grub/stage2_eltorito";
|
source = "${pkgs.grub}/lib/grub/i386-pc/stage2_eltorito";
|
||||||
}
|
target = "boot/grub/stage2_eltorito";
|
||||||
{ source = grubCfg;
|
}
|
||||||
target = "boot/grub/menu.lst";
|
{
|
||||||
}]
|
source = grubCfg;
|
||||||
|
target = "boot/grub/menu.lst";
|
||||||
|
}
|
||||||
|
]
|
||||||
++
|
++
|
||||||
(lib.concatLists (map systemPackInstallRootList systemPacks))
|
(lib.concatLists (map systemPackInstallRootList systemPacks))
|
||||||
++
|
++
|
||||||
[{ source = system.config.boot.grubSplashImage;
|
[
|
||||||
target = "boot/background.xpm.gz";
|
{
|
||||||
}
|
source = system.config.boot.grubSplashImage;
|
||||||
{ source = cdMountPoints;
|
target = "boot/background.xpm.gz";
|
||||||
target = "/";
|
}
|
||||||
}
|
{
|
||||||
{ source = nixosTarball + "/" + nixosTarball.tarName;
|
source = cdMountPoints;
|
||||||
target = "/" + nixosTarball.tarName;
|
target = "/";
|
||||||
}
|
}
|
||||||
{ source = nixpkgsTarball;
|
{
|
||||||
target = "/nixpkgs.tar.bz2";
|
source = nixosTarball + "/" + nixosTarball.tarName;
|
||||||
}
|
target = "/install/" + nixosTarball.tarName;
|
||||||
]
|
}
|
||||||
++
|
{
|
||||||
(lib.optional includeMemtest
|
source = nixpkgsTarball;
|
||||||
{ source = pkgs.memtest86 + "/memtest.bin";
|
target = "/install/nixpkgs.tar.bz2";
|
||||||
target = "boot/memtest.bin";
|
}
|
||||||
}
|
]
|
||||||
)
|
++
|
||||||
;};
|
(lib.optional includeMemtest
|
||||||
|
{
|
||||||
|
source = pkgs.memtest86 + "/memtest.bin";
|
||||||
|
target = "boot/memtest.bin";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
# Closures to be copied to the Nix store on the CD.
|
# Closures to be copied to the Nix store on the CD.
|
||||||
storeContents = lib.uniqListExt {
|
storeContents = lib.uniqListExt {
|
||||||
inputList= lib.concatLists
|
inputList= lib.concatLists
|
||||||
(map systemPackInstallClosures systemPacks);
|
(map systemPackInstallClosures systemPacks);
|
||||||
getter = x : x.object.drvPath;
|
getter = x : x.object.drvPath;
|
||||||
compare = lib.eqStrings;
|
compare = lib.eqStrings;
|
||||||
|
};
|
||||||
|
|
||||||
|
buildStoreContents = lib.uniqList
|
||||||
|
{
|
||||||
|
inputList=([]
|
||||||
|
++
|
||||||
|
(if includeBuildDeps then lib.concatLists
|
||||||
|
(map systemPackInstallBuildClosure systemPacks)
|
||||||
|
else [])
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
buildStoreContents = lib.uniqList {inputList=([]
|
|
||||||
++
|
|
||||||
(if includeBuildDeps then lib.concatLists
|
|
||||||
(map systemPackInstallBuildClosure systemPacks)
|
|
||||||
else [])
|
|
||||||
);};
|
|
||||||
|
|
||||||
bootable = true;
|
bootable = true;
|
||||||
bootImage = "boot/grub/stage2_eltorito";
|
bootImage = "boot/grub/stage2_eltorito";
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue