@ -64,6 +64,12 @@
, # Disk image format, one of qcow2, qcow2-compressed, vdi, vpc, raw.
format ? " r a w "
, # Whether a nix channel based on the current source tree should be
# made available inside the image. Useful for interactive use of nix
# utils, but changes the hash of the image when the sources are
# updated.
copyChannel ? true
} :
assert partitionTableType == " l e g a c y " || partitionTableType == " l e g a c y + g p t " || partitionTableType == " e f i " || partitionTableType == " h y b r i d " || partitionTableType == " n o n e " ;
@ -166,7 +172,9 @@ let format' = format; in let
users = map ( x : x . user or " ' ' " ) contents ;
groups = map ( x : x . group or " ' ' " ) contents ;
closureInfo = pkgs . closureInfo { rootPaths = [ config . system . build . toplevel channelSources ] ; } ;
closureInfo = pkgs . closureInfo {
rootPaths = [ config . system . build . toplevel ] ++ ( lib . optional copyChannel channelSources ) ;
} ;
blockSize = toString ( 4 * 1024 ) ; # ext4fs block size (not block device sector size)
@ -254,7 +262,9 @@ let format' = format; in let
chmod 755 " $ T M P D I R "
echo " r u n n i n g n i x o s - i n s t a l l . . . "
nixos-install - - root $ root - - no-bootloader - - no-root-passwd \
- - system $ { config . system . build . toplevel } - - channel $ { channelSources } - - substituters " "
- - system $ { config . system . build . toplevel } \
$ { if copyChannel then " - - c h a n n e l ${ channelSources } " else " - - n o - c h a n n e l - c o p y " } \
- - substituters " "
diskImage = nixos . raw