nixpkgs-mozilla icon indicating copy to clipboard operation
nixpkgs-mozilla copied to clipboard

Firefox allow overriding with custom policy.json in distribution

Open toastal opened this issue 3 years ago • 1 comments

Because the store is immutable (therefore the file in /distribution can't be modified)/and these bins don't appear to read from /etc/mozilla/firefox/policies, it would be ideal to have a way to inject some custom settings.

A web search did not reveal any clear or satisfactory ways to accomplish this all saying you need to build from source (which failed for me), or set the store to allow writing, or installing the bin from outside of Nix, or trying to inject the script into /run/user and then be picked up by Firefox after about:config flag is checked and browser restarted. All of these seem bad given Nix likes to have declarative config files.

toastal avatar Dec 30 '20 04:12 toastal

Currently the policies.json is inherited from https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/firefox-bin/default.nix#L179

It is used as follow: https://github.com/mozilla/nixpkgs-mozilla/blob/master/firefox-overlay.nix#L142-L154

Which reuses the building expression from Nixpkgs, and replaces the source binary.

While this can be done without modifying Nixpkgs, I will highly suggest making it possible within Nixpkgs, such that this overlay can benefit from it as well. Otherwise, you might be able to a similar thing with overrideAttrs without modifying nor Nixpkgs nor this overlay.

nbp avatar Mar 08 '21 18:03 nbp