Skip to content

error: The unique option `system.build.installBootLoader' is defined multiple times. #156373

@SFrijters

Description

@SFrijters

Describe the bug

After updating my system flake I get this error on rebuild:

building the system configuration...
error: The unique option `system.build.installBootLoader' is defined multiple times. Definition values:
       - In `/nix/store/if27n2zk0w5s62jk2bq32qm33r4xzyd0-source/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix': <derivation /nix/store/137hq8hkiicgi8zkmbpvnmqwbgr0ds9c-systemd-boot.drv>
       - In `/nix/store/if27n2zk0w5s62jk2bq32qm33r4xzyd0-source/nixos/modules/system/boot/loader/grub/grub.nix': <derivation /nix/store/4nmjqwyazvpaq9qbly4gd25gbijxb0pz-install-grub.sh.drv>

The relevant section of my configuration.nix is (I think):

  # Use the systemd-boot EFI boot loader.
  boot = {
    loader = {
      timeout = 10;
      systemd-boot.enable = true;
      efi.canTouchEfiVariables = true;
      grub = {
        enable = true;
        device = "nodev";
        efiSupport = true;
        useOSProber = true;
      };
    };
   ...

I assume this has something to do with #155963 - what would be the proper way to resolve this? I think one of them would have won out over the other before, is there any way to know which one so I can keep the status quo?

Steps To Reproduce

Have the above snippet of configuration in configuration.nix, build the system with nixpkgs 80458a3.

Expected behavior

The system builds succesfully.

Notify maintainers

@roberth @ncfavier

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 5.16.0, NixOS, 22.05 (Quokka)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.6.0pre20211217_6e6e998`
 - channels(frijters): `""`
 - channels(root): `"nixos, nixos-unstable-20.09pre225264.683c68232e9"`
 - nixpkgs: `/etc/nixpkgs`

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions