firefox: make nativeMessagingHosts unique

In case of duplicated messaging hosts, path collisions make the firefox drv fail to build.

Repro:
```nix
pkgs.firefox.override { nativeMessagingHosts = [ pkgs.passff-host pkgs.passff-host ]; }
```

This may happen e.g. if `programs.firefox.nativeMessagingHosts.packages` is
set in multiple locations with duplicated messaging hosts.

Calling `lib.unique` resolves the issue if an identical messaging host is duplicated,
but does correctly throw if multiple different native messaging host
packages try to provide the same native messaging host interface.
This commit is contained in:
Grimmauld
2026-01-02 14:53:31 +01:00
parent e22f516981
commit 08ee43aabb
@@ -89,7 +89,7 @@ let
# PCSC-Lite daemon (services.pcscd) also must be enabled for firefox to access smartcards
smartcardSupport = cfg.smartcardSupport or false;
allNativeMessagingHosts = map lib.getBin nativeMessagingHosts;
allNativeMessagingHosts = map lib.getBin (lib.unique nativeMessagingHosts);
libs =
lib.optionals stdenv.hostPlatform.isLinux (