Skip to content

Commit d979b45

Browse files
committed
nixos/iso-image: avoid collision between GRUB2 versions
4b836fb added `pkgs.grub2_efi` to `environment.systemPackages` so that it would be in the Nix store and available for install. But `pkgs.grub2` is already in the list. This causes the various paths of the two GRUB2 versions to collide. To fix this, put `pkgs.grub2_efi` into `system.extraDependencies` instead. This should achieve the same effect of adding the second GRUB2 version to the Nix store without the paths colliding in the environment. To reproduce the problem, execute `nix-build nixos -I nixos-config=nixos/modules/installer/cd-dvd/iso-image.nix -A config.system.build.isoImage` and look for messages like ``` warning: collision between `/nix/store/9jk1p9n5dl431lcm4w9p6x6x8a00dm0q-grub-2.12/bin/grub-install' and `/nix/store/809l0i6aydg4zhn3kqf723brjyp2qm8h-grub-2.12/bin/grub-install' ```
1 parent 9b9ca77 commit d979b45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nixos/modules/installer/cd-dvd/iso-image.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,9 +772,10 @@ in
772772
# here and it causes a cyclic dependency.
773773
boot.loader.grub.enable = false;
774774

775-
environment.systemPackages = [ grubPkgs.grub2 grubPkgs.grub2_efi ]
775+
environment.systemPackages = [ grubPkgs.grub2 ]
776776
++ lib.optional (config.isoImage.makeBiosBootable) pkgs.syslinux
777777
;
778+
system.extraDependencies = [ grubPkgs.grub2_efi ];
778779

779780
# In stage 1 of the boot, mount the CD as the root FS by label so
780781
# that we don't need to know its device. We pass the label of the

0 commit comments

Comments
 (0)