Firefox "apz.*" preferences don't work

Hi! Recently I’ve discovered that FF can be configured declaratively and it’s HUGE.

But for some reason, “apz.*” settings don’t apply to my configuration. Here’s my config:

{ config, pkgs, lib, ... }:
let
  lock-false = {
    Value = false;
    Status = "locked";
  };
  lock-true = {
    Value = true;
    Status = "locked";
  };
in
{
  programs.firefox = {
    enable = true;
    preferences = {
      "apz.gtk.kinetic_scroll.enabled" = false;
    };
    policies = {
      Preferences = {
        "widget.wayland.vsync.enabled" = lock-false;
        "widget.wayland.opaque-region.enabled" = lock-false;
        "media.ffmpeg.vaapi.enabled" = lock-true;
        "media.hardware-video-decoding.force-enabled" = lock-true;
        "apz.fling_friction" = "0.009";
      };
    };
  };
}

As you can see, I’ve tried both package.firefox.preferences and package.firefox.policies.Preferences. And also tried fling_friction as a number, but for some reason linter refused to accept such type:

error: A definition for option `programs.firefox.preferences."apz.fling_friction"' is not of type `boolean or signed integer or string'.

(UPD: because of this. Don’t know why there’s no float)

Other provided options such as vsync and vaapi work as expected.

Can you please help me find out, why apz.* don’t work?

1 Like

hey! same here! except i have quite a bit more stuff taken from this thread, and none of it works! it stopped working just this morning for me. extensions cant be installed declaratively, policies cant be declared, including preferences themselves! perhaps… we have to wait for an update (on this)

Yes,
Firefox and Librewolf declarative profiles are on/off broken/working from time to time.

Current status is:

  • master: fixed since 4 days
  • unstable-small: fixed since 3 days
  • unstable: fixed since 2 days
  • dont know about release backports

In general, its awesome, its huge and you can define every corner in every detail.

latest problem:

Firefox/Librewolf gets quite a lot of upstream braking changes, needs permanent fixing and magically attractants a lot of other funny ‘interests’.

Just declare everything via nix, and wipe (or impermanence) your profile on shutdown.

Then you are immediately aware about any problem.

2 Likes

unstable is fixed? but i literally just downloaded it and its still broken…? :confused:

…should i just get one from the stable branch then and/or just wait until 25.05 stable is out?

EDIT: may 12th, still no worky - completely useless options :frowning:

programs.firefox.preferences (which in the nixos module sets values in programs.firefox.policies.Preferences) only supports certain values (listed at policy-templates | Policy Templates for Firefox).

I personally use the home-manager module with programs.firefox.profiles.<name>.settings for values unsupported by programs.firefox.policies.Preferences.

It looks like the nixos module has a way to set values unsupported by policies through programs.firefox.autoConfig.

1 Like

i AM using programs.firefox.policies.Preferences and neither the .policies nor .Preferences work with ANYTHING from mozilla’s policy-templates, and it did use to work just about a few days ago (5 from now), without home-manager… :sob:

i feel like a disorientated frog without my declarative browser settings… welp, still waiting for a fix! :smiley: :+1:

i guess i will have to give programs.firefox.autoConfig a try… i have no idea how i will translate what i have in my config (extensions and their settings, preferences in nix into js, etc.) into AutoConfig functions… EDIT: i did not, in fact, give it a try…

P.S. i shouldve mentioned that i am using librewolf, also a gecko-based browser, which has had a patch error i believe in unstable, 5 days ago, coincidentally? anyway, before you ask, NO, i do not want to try those options with a firefox, thank you :slight_smile:

okay guys, i think i found the problem…

so there’s this option programs.firefox.policies.* that used to work with librewolf, right? well, apparently now it’s in /etc/firefox/policies/policies.json which has no effect on librewolf… im not sure if it was like this before version 138, but yeah… wait a minute, cant i just symlink this to $HOME/.librewolf/profile.default/? err, maybe this is a bad idea