Skip to content

Commit

Permalink
firefox-bin: link native-messaging-hosts to correct location
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Sep 25, 2024
1 parent f173d08 commit 296632c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkgs/applications/networking/browsers/firefox/wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ let
, extraPoliciesFiles ? []
, libName ? browser.libName or "firefox" # Important for tor package or the like
, nixExtensions ? null
, hasMozSystemDirPatch ? (lib.hasPrefix "firefox" pname && !lib.hasSuffix "-bin" pname)
}:

let
Expand Down Expand Up @@ -318,12 +319,18 @@ let
${lib.optionalString (!xdg-utils.meta.broken) "--suffix PATH ':' \"${xdg-utils}/bin\""} \
--suffix PATH ':' "$out/bin" \
--set MOZ_APP_LAUNCHER "${launcherName}" \
'' + lib.optionalString hasMozSystemDirPatch ''
--set MOZ_SYSTEM_DIR "$out/lib/mozilla" \
'' + ''
--set MOZ_LEGACY_PROFILES 1 \
--set MOZ_ALLOW_DOWNGRADE 1 \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
--suffix XDG_DATA_DIRS : '${gnome.adwaita-icon-theme}/share' \
--set-default MOZ_ENABLE_WAYLAND 1 \
'' + lib.optionalString (!hasMozSystemDirPatch) ''
${lib.optionalString (allNativeMessagingHosts != []) "--run \"mkdir -p \\\${MOZ_HOME:-~/.mozilla}/native-messaging-hosts\""} \
${lib.concatMapStringsSep " " (ext: "--run \"ln -sfLt \\\${MOZ_HOME:-~/.mozilla}/native-messaging-hosts ${ext}/lib/mozilla/native-messaging-hosts/*\"") allNativeMessagingHosts} \
'' + ''
"''${oldWrapperArgs[@]}"
#############################
# #
Expand All @@ -346,10 +353,12 @@ let
install -D -t $out/share/applications $desktopItem/share/applications/*
'' + lib.optionalString hasMozSystemDirPatch ''
mkdir -p $out/lib/mozilla/native-messaging-hosts
for ext in ${toString allNativeMessagingHosts}; do
ln -sLt $out/lib/mozilla/native-messaging-hosts $ext/lib/mozilla/native-messaging-hosts/*
done
'' + ''
mkdir -p $out/lib/mozilla/pkcs11-modules
for ext in ${toString pkcs11Modules}; do
Expand Down

0 comments on commit 296632c

Please sign in to comment.