nixos/systemd-boot: Add basic test
This commit is contained in:
@@ -189,9 +189,18 @@ let
|
||||
mkdir /boot/grub
|
||||
echo '(hd0) /dev/vda' > /boot/grub/device.map
|
||||
|
||||
# Install GRUB and generate the GRUB boot menu.
|
||||
touch /etc/NIXOS
|
||||
# This is needed for systemd-boot to find ESP, and udev is not available here to create this
|
||||
mkdir -p /dev/block
|
||||
ln -s /dev/vda2 /dev/block/254:2
|
||||
|
||||
# Set up system profile (normally done by nixos-rebuild / nix-env --set)
|
||||
mkdir -p /nix/var/nix/profiles
|
||||
ln -s ${config.system.build.toplevel} /nix/var/nix/profiles/system-1-link
|
||||
ln -s /nix/var/nix/profiles/system-1-link /nix/var/nix/profiles/system
|
||||
|
||||
# Install bootloader
|
||||
touch /etc/NIXOS
|
||||
export NIXOS_INSTALL_BOOTLOADER=1
|
||||
${config.system.build.toplevel}/bin/switch-to-configuration boot
|
||||
|
||||
umount /boot
|
||||
|
||||
Reference in New Issue
Block a user