firefox: allow overriding config of wrapped package

By moving the `cfg` variable into the wrapper arguments we are able to
override it for an already wrapped package. For example, with this
change one can have

    pkgs.firefox-devedition-bin.override {
      cfg.enableBrowserpass = true;
    }

which would otherwise be difficult to accomplish for packages having a
complicated wrapped definition in `all-packages.nix`.
This commit is contained in:
Robert Helgesson 2019-06-25 22:17:21 +02:00
parent 13b8156030
commit 06d8666a60
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89

View File

@ -28,12 +28,12 @@ let
, extraPlugins ? [] , extraPlugins ? []
, extraNativeMessagingHosts ? [] , extraNativeMessagingHosts ? []
, gdkWayland ? false , gdkWayland ? false
, cfg ? config.${browserName} or {}
}: }:
assert gdkWayland -> (browser ? gtk3); # Can only use the wayland backend if gtk3 is being used assert gdkWayland -> (browser ? gtk3); # Can only use the wayland backend if gtk3 is being used
let let
cfg = config.${browserName} or {};
enableAdobeFlash = cfg.enableAdobeFlash or false; enableAdobeFlash = cfg.enableAdobeFlash or false;
ffmpegSupport = browser.ffmpegSupport or false; ffmpegSupport = browser.ffmpegSupport or false;
gssSupport = browser.gssSupport or false; gssSupport = browser.gssSupport or false;