diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl index 82809edd6e8..d0d5307a804 100644 --- a/nixos/modules/system/boot/loader/grub/install-grub.pl +++ b/nixos/modules/system/boot/loader/grub/install-grub.pl @@ -158,6 +158,11 @@ sub GrubFs { my $grubBoot = GrubFs("/boot"); my $grubStore = GrubFs("/nix"); +# We don't need to copy if we can read the kernels directly +if ($grubStore->search ne "") { + $copyKernels = 0; +} + # Generate the header. my $conf .= "# Automatically generated. DO NOT EDIT THIS FILE!\n";