1{ stdenv, perl, pathsFromGraph, xorriso, syslinux
2
3, # The file name of the resulting ISO image.
4 isoName ? "cd.iso"
5
6, # The files and directories to be placed in the ISO file system.
7 # This is a list of attribute sets {source, target} where `source'
8 # is the file system object (regular file or directory) to be
9 # grafted in the file system at path `target'.
10 contents
11
12, # In addition to `contents', the closure of the store paths listed
13 # in `packages' are also placed in the Nix store of the CD. This is
14 # a list of attribute sets {object, symlink} where `object' if a
15 # store path whose closure will be copied, and `symlink' is a
16 # symlink to `object' that will be added to the CD.
17 storeContents ? []
18
19, # Whether this should be an El-Torito bootable CD.
20 bootable ? false
21
22, # Whether this should be an efi-bootable El-Torito CD.
23 efiBootable ? false
24
25, # Wheter this should be an hybrid CD (bootable from USB as well as CD).
26 usbBootable ? false
27
28, # The path (in the ISO file system) of the boot image.
29 bootImage ? ""
30
31, # The path (in the ISO file system) of the efi boot image.
32 efiBootImage ? ""
33
34, # The path (outside the ISO file system) of the isohybrid-mbr image.
35 isohybridMbrImage ? ""
36
37, # Whether to compress the resulting ISO image with bzip2.
38 compressImage ? false
39
40, # The volume ID.
41 volumeID ? ""
42
43}:
44
45assert bootable -> bootImage != "";
46assert efiBootable -> efiBootImage != "";
47assert usbBootable -> isohybridMbrImage != "";
48
49stdenv.mkDerivation {
50 name = "iso9660-image";
51 builder = ./make-iso9660-image.sh;
52 buildInputs = [perl xorriso syslinux];
53
54 inherit isoName bootable bootImage compressImage volumeID pathsFromGraph efiBootImage efiBootable isohybridMbrImage usbBootable;
55
56 # !!! should use XML.
57 sources = map (x: x.source) contents;
58 targets = map (x: x.target) contents;
59
60 # !!! should use XML.
61 objects = map (x: x.object) storeContents;
62 symlinks = map (x: x.symlink) storeContents;
63
64 # For obtaining the closure of `storeContents'.
65 exportReferencesGraph =
66 map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents;
67}