From 760b2b9048ea775c319cb348d74447a20dea513e Mon Sep 17 00:00:00 2001 From: obadz Date: Mon, 15 Aug 2016 19:39:39 +0100 Subject: nixos/make-disk-image: add ability to defer bootloader install until image has been flashed --- nixos/lib/make-disk-image.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index 63666c99b230..9f8ec4192564 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -12,6 +12,9 @@ # directly. partitioned ? true + # Whether to invoke switch-to-configuration boot during image creation +, installBootLoader ? true + , # The root file system type. fsType ? "ext4" @@ -108,7 +111,7 @@ pkgs.vmTools.runInLinuxVM ( # Generate the GRUB menu. ln -s vda /dev/xvda ln -s vda /dev/sda - chroot /mnt ${config.system.build.toplevel}/bin/switch-to-configuration boot + ${optionalString installBootLoader "chroot /mnt ${config.system.build.toplevel}/bin/switch-to-configuration boot"} umount /mnt/proc /mnt/dev /mnt/sys umount /mnt -- cgit 1.4.1