2009-06-05 15:35:27 +02:00
|
|
|
# This module creates a bootable ISO image containing the given NixOS
|
|
|
|
# configuration. The derivation for the ISO image will be placed in
|
|
|
|
# config.system.build.isoImage.
|
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2009-11-14 17:12:02 +01:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2009-06-05 15:35:27 +02:00
|
|
|
|
|
|
|
let
|
2014-11-16 20:11:56 +01:00
|
|
|
# Timeout in syslinux is in units of 1/10 of a second.
|
|
|
|
# 0 is used to disable timeouts.
|
|
|
|
syslinuxTimeout = if config.boot.loader.timeout == null then
|
|
|
|
0
|
|
|
|
else
|
|
|
|
max (config.boot.loader.timeout * 10) 1;
|
|
|
|
|
|
|
|
|
|
|
|
max = x: y: if x > y then x else y;
|
2009-06-09 14:01:31 +02:00
|
|
|
|
2014-10-26 21:29:04 +01:00
|
|
|
# The configuration file for syslinux.
|
2014-11-16 20:13:11 +01:00
|
|
|
|
|
|
|
# Notes on syslinux configuration and UNetbootin compatiblity:
|
|
|
|
# * Do not use '/syslinux/syslinux.cfg' as the path for this
|
|
|
|
# configuration. UNetbootin will not parse the file and use it as-is.
|
|
|
|
# This results in a broken configuration if the partition label does
|
|
|
|
# not match the specified config.isoImage.volumeID. For this reason
|
|
|
|
# we're using '/isolinux/isolinux.cfg'.
|
|
|
|
# * Use APPEND instead of adding command-line arguments directly after
|
|
|
|
# the LINUX entries.
|
|
|
|
# * COM32 entries (chainload, reboot, poweroff) are not recognized. They
|
|
|
|
# result in incorrect boot entries.
|
|
|
|
|
2015-07-25 19:03:52 +02:00
|
|
|
baseIsolinuxCfg = ''
|
2014-10-26 21:29:04 +01:00
|
|
|
SERIAL 0 38400
|
2014-11-16 20:11:56 +01:00
|
|
|
TIMEOUT ${builtins.toString syslinuxTimeout}
|
2014-10-26 21:29:04 +01:00
|
|
|
UI vesamenu.c32
|
|
|
|
MENU TITLE NixOS
|
|
|
|
MENU BACKGROUND /isolinux/background.png
|
2014-11-16 20:11:56 +01:00
|
|
|
DEFAULT boot
|
2014-10-26 21:29:04 +01:00
|
|
|
|
|
|
|
LABEL boot
|
2015-09-18 18:50:48 +02:00
|
|
|
MENU LABEL NixOS ${config.system.nixosLabel}${config.isoImage.appendToMenuLabel}
|
2014-11-16 20:13:11 +01:00
|
|
|
LINUX /boot/bzImage
|
|
|
|
APPEND init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
|
2014-10-26 21:29:04 +01:00
|
|
|
INITRD /boot/initrd
|
2015-12-24 18:31:07 +01:00
|
|
|
|
|
|
|
# A variant to boot with 'nomodeset'
|
|
|
|
LABEL boot-nomodeset
|
|
|
|
MENU LABEL NixOS ${config.system.nixosVersion}${config.isoImage.appendToMenuLabel} (with nomodeset)
|
|
|
|
LINUX /boot/bzImage
|
|
|
|
APPEND init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} nomodeset
|
|
|
|
INITRD /boot/initrd
|
2015-07-25 19:03:52 +02:00
|
|
|
'';
|
2013-09-04 13:05:09 +02:00
|
|
|
|
2015-01-21 14:00:18 +01:00
|
|
|
isolinuxMemtest86Entry = ''
|
|
|
|
LABEL memtest
|
|
|
|
MENU LABEL Memtest86+
|
|
|
|
LINUX /boot/memtest.bin
|
|
|
|
APPEND ${toString config.boot.loader.grub.memtest86.params}
|
|
|
|
'';
|
|
|
|
|
2014-10-26 21:29:04 +01:00
|
|
|
isolinuxCfg = baseIsolinuxCfg + (optionalString config.boot.loader.grub.memtest86.enable isolinuxMemtest86Entry);
|
2014-11-08 13:09:08 +01:00
|
|
|
|
2015-07-25 19:03:52 +02:00
|
|
|
# The EFI boot image.
|
2013-11-15 00:18:27 +01:00
|
|
|
efiDir = pkgs.runCommand "efi-directory" {} ''
|
2014-10-26 21:29:04 +01:00
|
|
|
mkdir -p $out/EFI/boot
|
2016-06-01 11:14:00 +02:00
|
|
|
cp -v ${pkgs.systemd}/lib/systemd/boot/efi/systemd-boot${targetArch}.efi $out/EFI/boot/boot${targetArch}.efi
|
2013-11-15 00:18:27 +01:00
|
|
|
mkdir -p $out/loader/entries
|
2015-12-24 18:31:07 +01:00
|
|
|
|
2015-07-25 19:03:52 +02:00
|
|
|
echo "title NixOS Live CD" > $out/loader/entries/nixos-livecd.conf
|
2013-11-15 00:18:27 +01:00
|
|
|
echo "linux /boot/bzImage" >> $out/loader/entries/nixos-livecd.conf
|
|
|
|
echo "initrd /boot/initrd" >> $out/loader/entries/nixos-livecd.conf
|
|
|
|
echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" >> $out/loader/entries/nixos-livecd.conf
|
2015-12-24 18:31:07 +01:00
|
|
|
|
|
|
|
# A variant to boot with 'nomodeset'
|
|
|
|
echo "title NixOS Live CD (with nomodeset)" > $out/loader/entries/nixos-livecd-nomodeset.conf
|
|
|
|
echo "linux /boot/bzImage" >> $out/loader/entries/nixos-livecd-nomodeset.conf
|
|
|
|
echo "initrd /boot/initrd" >> $out/loader/entries/nixos-livecd-nomodeset.conf
|
|
|
|
echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} nomodeset" >> $out/loader/entries/nixos-livecd-nomodeset.conf
|
|
|
|
|
2013-11-15 00:18:27 +01:00
|
|
|
echo "default nixos-livecd" > $out/loader/loader.conf
|
2016-05-25 10:34:54 +02:00
|
|
|
echo "timeout ${builtins.toString config.boot.loader.timeout}" >> $out/loader/loader.conf
|
2013-11-15 00:18:27 +01:00
|
|
|
'';
|
|
|
|
|
2015-03-24 22:34:28 +01:00
|
|
|
efiImg = pkgs.runCommand "efi-image_eltorito" { buildInputs = [ pkgs.mtools pkgs.libfaketime ]; }
|
|
|
|
# Be careful about determinism: du --apparent-size,
|
|
|
|
# dates (cp -p, touch, mcopy -m, faketime for label), IDs (mkfs.vfat -i)
|
2013-09-04 13:05:09 +02:00
|
|
|
''
|
2015-03-24 22:34:28 +01:00
|
|
|
mkdir ./contents && cd ./contents
|
|
|
|
cp -rp "${efiDir}"/* .
|
|
|
|
mkdir ./boot
|
|
|
|
cp -p "${config.boot.kernelPackages.kernel}/bzImage" \
|
|
|
|
"${config.system.build.initialRamdisk}/initrd" ./boot/
|
|
|
|
touch --date=@0 ./*
|
|
|
|
|
|
|
|
usage_size=$(du -sb --apparent-size . | tr -cd '[:digit:]')
|
|
|
|
# Make the image 110% as big as the files need to make up for FAT overhead
|
|
|
|
image_size=$(( ($usage_size * 110) / 100 ))
|
|
|
|
# Make the image fit blocks of 1M
|
|
|
|
block_size=$((1024*1024))
|
|
|
|
image_size=$(( ($image_size / $block_size + 1) * $block_size ))
|
|
|
|
echo "Usage size: $usage_size"
|
|
|
|
echo "Image size: $image_size"
|
|
|
|
truncate --size=$image_size "$out"
|
|
|
|
${pkgs.libfaketime}/bin/faketime "2000-01-01 00:00:00" ${pkgs.dosfstools}/sbin/mkfs.vfat -i 12345678 -n EFIBOOT "$out"
|
|
|
|
mcopy -bpsvm -i "$out" ./* ::
|
2014-05-21 14:06:31 +02:00
|
|
|
''; # */
|
2013-09-04 13:05:09 +02:00
|
|
|
|
|
|
|
targetArch = if pkgs.stdenv.isi686 then
|
|
|
|
"ia32"
|
|
|
|
else if pkgs.stdenv.isx86_64 then
|
|
|
|
"x64"
|
|
|
|
else
|
|
|
|
throw "Unsupported architecture";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2009-06-09 14:01:31 +02:00
|
|
|
options = {
|
|
|
|
|
2009-11-14 17:12:02 +01:00
|
|
|
isoImage.isoName = mkOption {
|
2015-04-28 05:10:53 +02:00
|
|
|
default = "${config.isoImage.isoBaseName}.iso";
|
2009-06-09 17:23:03 +02:00
|
|
|
description = ''
|
|
|
|
Name of the generated ISO image file.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-04-20 12:48:52 +02:00
|
|
|
isoImage.isoBaseName = mkOption {
|
|
|
|
default = "nixos";
|
|
|
|
description = ''
|
|
|
|
Prefix of the name of the generated ISO image file.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2009-11-14 17:12:02 +01:00
|
|
|
isoImage.compressImage = mkOption {
|
2009-06-09 17:23:03 +02:00
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether the ISO image should be compressed using
|
|
|
|
<command>bzip2</command>.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2009-11-14 17:12:02 +01:00
|
|
|
isoImage.volumeID = mkOption {
|
2009-06-09 17:23:03 +02:00
|
|
|
default = "NIXOS_BOOT_CD";
|
|
|
|
description = ''
|
|
|
|
Specifies the label or volume ID of the generated ISO image.
|
|
|
|
Note that the label is used by stage 1 of the boot process to
|
|
|
|
mount the CD, so it should be reasonably distinctive.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2009-11-14 17:12:02 +01:00
|
|
|
isoImage.contents = mkOption {
|
2014-08-27 23:41:15 +02:00
|
|
|
example = literalExample ''
|
2009-06-09 14:01:31 +02:00
|
|
|
[ { source = pkgs.memtest86 + "/memtest.bin";
|
|
|
|
target = "boot/memtest.bin";
|
|
|
|
}
|
2014-08-27 23:41:15 +02:00
|
|
|
]
|
|
|
|
'';
|
2009-06-09 14:01:31 +02:00
|
|
|
description = ''
|
2009-06-09 15:27:50 +02:00
|
|
|
This option lists files to be copied to fixed locations in the
|
|
|
|
generated ISO image.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2009-11-14 17:12:02 +01:00
|
|
|
isoImage.storeContents = mkOption {
|
2014-08-27 23:41:15 +02:00
|
|
|
example = literalExample "[ pkgs.stdenv ]";
|
2009-06-09 15:27:50 +02:00
|
|
|
description = ''
|
|
|
|
This option lists additional derivations to be included in the
|
|
|
|
Nix store in the generated ISO image.
|
2009-06-09 14:01:31 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2010-08-29 14:11:31 +02:00
|
|
|
isoImage.includeSystemBuildDependencies = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = ''
|
|
|
|
Set this option to include all the needed sources etc in the
|
|
|
|
image. It significantly increases image size. Use that when
|
|
|
|
you want to be able to keep all the sources needed to build your
|
|
|
|
system or when you are going to install the system on a computer
|
2016-12-30 12:29:43 +01:00
|
|
|
with slow or non-existent network connection.
|
2010-08-29 14:11:31 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2012-03-16 06:37:24 +01:00
|
|
|
isoImage.makeEfiBootable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
2012-03-16 12:31:33 +01:00
|
|
|
Whether the ISO image should be an efi-bootable volume.
|
2012-03-16 06:37:24 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2014-10-26 21:29:04 +01:00
|
|
|
isoImage.makeUsbBootable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether the ISO image should be bootable from CD as well as USB.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
isoImage.splashImage = mkOption {
|
|
|
|
default = pkgs.fetchurl {
|
|
|
|
url = https://raw.githubusercontent.com/NixOS/nixos-artwork/5729ab16c6a5793c10a2913b5a1b3f59b91c36ee/ideas/grub-splash/grub-nixos-1.png;
|
|
|
|
sha256 = "43fd8ad5decf6c23c87e9026170a13588c2eba249d9013cb9f888da5e2002217";
|
|
|
|
};
|
|
|
|
description = ''
|
|
|
|
The splash image to use in the bootloader.
|
|
|
|
'';
|
|
|
|
};
|
2012-03-16 06:37:24 +01:00
|
|
|
|
2015-06-28 23:26:54 +02:00
|
|
|
isoImage.appendToMenuLabel = mkOption {
|
|
|
|
default = " Installer";
|
|
|
|
example = " Live System";
|
|
|
|
description = ''
|
|
|
|
The string to append after the menu label for the NixOS system.
|
|
|
|
This will be directly appended (without whitespace) to the NixOS version
|
|
|
|
string, like for example if it is set to <literal>XXX</literal>:
|
|
|
|
|
|
|
|
<para><literal>NixOS 99.99-pre666XXX</literal></para>
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2009-06-09 14:01:31 +02:00
|
|
|
};
|
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
config = {
|
2009-11-10 22:42:38 +01:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
boot.loader.grub.version = 2;
|
2009-11-10 22:42:38 +01:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
# Don't build the GRUB menu builder script, since we don't need it
|
|
|
|
# here and it causes a cyclic dependency.
|
|
|
|
boot.loader.grub.enable = false;
|
2009-11-13 17:45:41 +01:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
# !!! Hack - attributes expected by other modules.
|
|
|
|
system.boot.loader.kernelFile = "bzImage";
|
2015-07-06 04:11:56 +02:00
|
|
|
environment.systemPackages = [ pkgs.grub2 pkgs.grub2_efi pkgs.syslinux ];
|
2009-11-13 17:45:41 +01:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
# In stage 1 of the boot, mount the CD as the root FS by label so
|
|
|
|
# that we don't need to know its device. We pass the label of the
|
|
|
|
# root filesystem on the kernel command line, rather than in
|
|
|
|
# `fileSystems' below. This allows CD-to-USB converters such as
|
|
|
|
# UNetbootin to rewrite the kernel command line to pass the label or
|
|
|
|
# UUID of the USB stick. It would be nicer to write
|
|
|
|
# `root=/dev/disk/by-label/...' here, but UNetbootin doesn't
|
|
|
|
# recognise that.
|
2014-11-15 00:14:26 +01:00
|
|
|
boot.kernelParams =
|
|
|
|
[ "root=LABEL=${config.isoImage.volumeID}"
|
|
|
|
"boot.shell_on_fail"
|
|
|
|
];
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2014-05-21 14:06:31 +02:00
|
|
|
fileSystems."/" =
|
|
|
|
{ fsType = "tmpfs";
|
2015-10-21 19:37:14 +02:00
|
|
|
options = [ "mode=0755" ];
|
2014-05-21 14:06:31 +02:00
|
|
|
};
|
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
# Note that /dev/root is a symlink to the actual root device
|
2014-05-21 14:06:31 +02:00
|
|
|
# specified on the kernel command line, created in the stage 1
|
|
|
|
# init script.
|
|
|
|
fileSystems."/iso" =
|
|
|
|
{ device = "/dev/root";
|
|
|
|
neededForBoot = true;
|
|
|
|
noCheck = true;
|
|
|
|
};
|
2009-11-13 17:45:41 +01:00
|
|
|
|
2014-07-30 15:44:47 +02:00
|
|
|
# In stage 1, mount a tmpfs on top of /nix/store (the squashfs
|
|
|
|
# image) to make this a live CD.
|
2014-05-21 14:06:31 +02:00
|
|
|
fileSystems."/nix/.ro-store" =
|
2013-09-04 13:05:09 +02:00
|
|
|
{ fsType = "squashfs";
|
2014-05-21 14:06:31 +02:00
|
|
|
device = "/iso/nix-store.squashfs";
|
2015-10-21 19:37:14 +02:00
|
|
|
options = [ "loop" ];
|
2014-05-21 14:06:31 +02:00
|
|
|
neededForBoot = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/nix/.rw-store" =
|
|
|
|
{ fsType = "tmpfs";
|
2015-10-21 19:37:14 +02:00
|
|
|
options = [ "mode=0755" ];
|
2014-05-21 14:06:31 +02:00
|
|
|
neededForBoot = true;
|
2013-09-04 13:05:09 +02:00
|
|
|
};
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2014-07-30 15:44:47 +02:00
|
|
|
fileSystems."/nix/store" =
|
|
|
|
{ fsType = "unionfs-fuse";
|
|
|
|
device = "unionfs";
|
2015-10-21 19:37:14 +02:00
|
|
|
options = [ "allow_other" "cow" "nonempty" "chroot=/mnt-root" "max_files=32768" "hide_meta_files" "dirs=/nix/.rw-store=rw:/nix/.ro-store=ro" ];
|
2014-07-30 15:44:47 +02:00
|
|
|
};
|
|
|
|
|
2014-10-26 21:29:04 +01:00
|
|
|
boot.initrd.availableKernelModules = [ "squashfs" "iso9660" "usb-storage" ];
|
2012-03-16 06:37:24 +01:00
|
|
|
|
2015-07-25 19:03:52 +02:00
|
|
|
boot.blacklistedKernelModules = [ "nouveau" ];
|
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
boot.initrd.kernelModules = [ "loop" ];
|
2012-03-16 06:37:24 +01:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
# Closures to be copied to the Nix store on the CD, namely the init
|
|
|
|
# script and the top-level system configuration directory.
|
|
|
|
isoImage.storeContents =
|
|
|
|
[ config.system.build.toplevel ] ++
|
|
|
|
optional config.isoImage.includeSystemBuildDependencies
|
|
|
|
config.system.build.toplevel.drvPath;
|
|
|
|
|
|
|
|
# Create the squashfs image that contains the Nix store.
|
|
|
|
system.build.squashfsStore = import ../../../lib/make-squashfs.nix {
|
|
|
|
inherit (pkgs) stdenv squashfsTools perl pathsFromGraph;
|
|
|
|
storeContents = config.isoImage.storeContents;
|
|
|
|
};
|
2010-01-09 16:13:06 +01:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
# Individual files to be included on the CD, outside of the Nix
|
|
|
|
# store on the CD.
|
|
|
|
isoImage.contents =
|
2014-10-26 21:29:04 +01:00
|
|
|
[ { source = pkgs.substituteAll {
|
|
|
|
name = "isolinux.cfg";
|
|
|
|
src = pkgs.writeText "isolinux.cfg-in" isolinuxCfg;
|
2013-10-02 12:29:07 +02:00
|
|
|
bootRoot = "/boot";
|
|
|
|
};
|
2014-10-26 21:29:04 +01:00
|
|
|
target = "/isolinux/isolinux.cfg";
|
2013-09-04 13:05:09 +02:00
|
|
|
}
|
|
|
|
{ source = config.boot.kernelPackages.kernel + "/bzImage";
|
|
|
|
target = "/boot/bzImage";
|
|
|
|
}
|
|
|
|
{ source = config.system.build.initialRamdisk + "/initrd";
|
|
|
|
target = "/boot/initrd";
|
|
|
|
}
|
2014-11-08 13:09:08 +01:00
|
|
|
{ source = config.system.build.squashfsStore;
|
|
|
|
target = "/nix-store.squashfs";
|
2014-10-26 21:29:04 +01:00
|
|
|
}
|
2014-10-26 21:29:04 +01:00
|
|
|
{ source = "${pkgs.syslinux}/share/syslinux";
|
|
|
|
target = "/isolinux";
|
|
|
|
}
|
|
|
|
{ source = config.isoImage.splashImage;
|
|
|
|
target = "/isolinux/background.png";
|
|
|
|
}
|
2013-10-02 12:29:07 +02:00
|
|
|
] ++ optionals config.isoImage.makeEfiBootable [
|
2013-09-04 13:05:09 +02:00
|
|
|
{ source = efiImg;
|
|
|
|
target = "/boot/efi.img";
|
|
|
|
}
|
2014-10-26 21:29:04 +01:00
|
|
|
{ source = "${efiDir}/EFI";
|
|
|
|
target = "/EFI";
|
2013-11-15 00:18:27 +01:00
|
|
|
}
|
|
|
|
{ source = "${efiDir}/loader";
|
|
|
|
target = "/loader";
|
|
|
|
}
|
2015-01-21 14:00:18 +01:00
|
|
|
] ++ optionals config.boot.loader.grub.memtest86.enable [
|
|
|
|
{ source = "${pkgs.memtest86plus}/memtest.bin";
|
|
|
|
target = "/boot/memtest.bin";
|
2014-11-08 13:09:08 +01:00
|
|
|
}
|
2014-10-26 21:29:04 +01:00
|
|
|
];
|
2014-11-08 13:09:08 +01:00
|
|
|
|
2014-11-16 20:11:56 +01:00
|
|
|
boot.loader.timeout = 10;
|
2009-06-05 15:35:27 +02:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
# Create the ISO image.
|
|
|
|
system.build.isoImage = import ../../../lib/make-iso9660-image.nix ({
|
2014-10-26 21:29:04 +01:00
|
|
|
inherit (pkgs) stdenv perl pathsFromGraph xorriso syslinux;
|
2009-06-10 18:29:48 +02:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
inherit (config.isoImage) isoName compressImage volumeID contents;
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
bootable = true;
|
2014-10-26 21:29:04 +01:00
|
|
|
bootImage = "/isolinux/isolinux.bin";
|
|
|
|
} // optionalAttrs config.isoImage.makeUsbBootable {
|
|
|
|
usbBootable = true;
|
|
|
|
isohybridMbrImage = "${pkgs.syslinux}/share/syslinux/isohdpfx.bin";
|
2013-10-02 12:29:07 +02:00
|
|
|
} // optionalAttrs config.isoImage.makeEfiBootable {
|
2013-09-04 13:05:09 +02:00
|
|
|
efiBootable = true;
|
|
|
|
efiBootImage = "boot/efi.img";
|
|
|
|
});
|
2009-06-09 14:01:31 +02:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
boot.postBootCommands =
|
|
|
|
''
|
|
|
|
# After booting, register the contents of the Nix store on the
|
|
|
|
# CD in the Nix database in the tmpfs.
|
2016-04-24 12:57:19 +02:00
|
|
|
${config.nix.package.out}/bin/nix-store --load-db < /nix/store/nix-path-registration
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
# nixos-rebuild also requires a "system" profile and an
|
|
|
|
# /etc/NIXOS tag.
|
|
|
|
touch /etc/NIXOS
|
2016-04-24 12:57:19 +02:00
|
|
|
${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system
|
2013-09-04 13:05:09 +02:00
|
|
|
'';
|
2009-06-05 15:35:27 +02:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
# Add vfat support to the initrd to enable people to copy the
|
2014-07-30 15:44:47 +02:00
|
|
|
# contents of the CD to a bootable USB stick.
|
|
|
|
boot.initrd.supportedFilesystems = [ "vfat" ];
|
2009-06-05 18:02:58 +02:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
};
|
2012-03-09 17:17:37 +01:00
|
|
|
|
2009-06-05 15:35:27 +02:00
|
|
|
}
|