Difficulties overriding Firefox with Home-Manager

Hi everyone.

I am using Nixos + Home-manager with flakes. I am currently having issues with setting extraPolicies. This configuration was previously working, but broke after re-installation. It is currently returning this error when I attempt a rebuild.

This is the section of code that I believe is causing the issue:

  programs.firefox.package = pkgs.wrapFirefox pkgs.firefox-unwrapped.override {
    extraPolicies = {

I have tried changing it to:

programs.firefox.package = pkgs.firefox.override 

This allows it to complete the rebuild, but does not implement the policies.

All of my Firefox configuration files can be found here

The rest of my configuration seems to be working. Including user-chrome, and user-prefs. My full configuration can be found here.

You need to override the wrapped Firefox instead of the unwrapped one. extraPolicies is implemented in the wrapper, presumably to avoid recompiling Firefox when users provide custom policies.