# Firefox "apz.\*" preferences don't work

**URL:** https://discourse.nixos.org/t/firefox-apz-preferences-dont-work/64006
**Category:** Help
**Created:** [May 8, 2025, 10:50am UTC](https://discourse.nixos.org/t/firefox-apz-preferences-dont-work/64006 "2025-05-08T10:50:33Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dmchmk](https://discourse.nixos.org/user_avatar/discourse.nixos.org/dmchmk/32/28641_2.png) [@dmchmk](https://discourse.nixos.org/u/dmchmk)
#### Post date: [May 8, 2025, 10:50am UTC](https://discourse.nixos.org/t/firefox-apz-preferences-dont-work/64006/1 "2025-05-08T10:50:33Z")

</div>

Hi! Recently I’ve discovered that FF [can be configured declaratively](https://discourse.nixos.org/t/combining-best-of-system-firefox-and-home-manager-firefox-settings/37721) and it’s HUGE.

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

```auto
{ 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](https://github.com/NixOS/nixpkgs/blob/1833d44778355902ae15bc3e05c5620a74c873ef/nixos/modules/programs/firefox.nix#L109-L113). 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?

---

<div class="post-metadata">

### Author: ![frozen.frog23](https://discourse.nixos.org/user_avatar/discourse.nixos.org/frozen.frog23/32/31895_2.png) [@frozen.frog23](https://discourse.nixos.org/u/frozen.frog23)
#### Post date: [May 9, 2025, 5:18pm UTC](https://discourse.nixos.org/t/firefox-apz-preferences-dont-work/64006/2 "2025-05-09T17:18:18Z")

</div>

hey! same here! except i have quite a bit more stuff taken from [this thread](https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265), 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)

---

<div class="post-metadata">

### Author: ![paepckehh](https://discourse.nixos.org/user_avatar/discourse.nixos.org/paepckehh/32/32264_2.png) [@paepckehh](https://discourse.nixos.org/u/paepckehh)
#### Post date: [May 10, 2025, 7:32pm UTC](https://discourse.nixos.org/t/firefox-apz-preferences-dont-work/64006/3 "2025-05-10T19:32:40Z")

</div>

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:

> <https://github.com/NixOS/nixpkgs/issues/404763>
>
> \### Nixpkgs version
> 
> \- Unstable (25.05)
> 
> \### Describe the bug
> 
> On the latest upd…ate of librewolf (\`138.0.1-2\`), the profile directory (generally \`~/.librewolf\`) is now in \`~/.mozilla/librewolf\`.
> When checking upstream, this is not the case, and same when running the flatpak leaving me to believe it's an error in the package.
> 
> \### Steps to reproduce
> 
> 1. Update Librewolf to its latest in \`nixos-unstable\` (\`138.0.1-2\`)
> 2. Observe the profile being completely reset, and stored in \`~/.mozilla/librewolf\`
> 
> \### Expected behaviour
> 
> profiles are stored in \`~/.librewolf\`
> 
> \### Screenshots
> 
> \_No response\_
> 
> \### Relevant log output
> 
> \`\`\`console
> 
> \`\`\`
> 
> \### Additional context
> 
> \_No response\_
> 
> \### System metadata
> 
> nix run nixpkgs#nix-info -- -m
> - system: \`"x86\_64-linux"\`
> - host os: \`Linux 6.14.5, NixOS, 25.05 (Warbler), 25.05.20250505.3730d8a\`
> - multi-user?: \`yes\`
> - sandbox: \`yes\`
> - version: \`nix-env (Nix) 2.28.3\`
> - nixpkgs: \`/nix/store/9rc9abg9f664bjfhzfp4cb8mrwh7b5y4-source\`
> 
> \### Notify maintainers
> 
> @squalus @DominicWrege @fpletz
> 
> \---
> 
> \*\*Note for maintainers:\*\* Please tag this issue in your pull request description. (i.e. \`Resolves #ISSUE\`.)
> 
> 
> \### I assert that this issue is relevant for Nixpkgs
> 
> \- \[x\] I assert that this is a bug and not a support request.
> \- \[x\] I assert that this is not a \[duplicate of an existing issue\](https://github.com/NixOS/nixpkgs/issues?q=is%3Aopen+is%3Aissue+label%3A%220.kind%3A+bug%22+-label%3A%226.topic%3A+darwin%22+-label%3A%226.topic%3A+nixos%22). 
> \- \[x\] I assert that I have read the \[NixOS Code of Conduct\](https://github.com/NixOS/.github/blob/master/CODE\_OF\_CONDUCT.md) and agree to abide by it.
> 
> \### Is this issue important to you?
> 
> Add a :+1: \[reaction\] to \[issues you find important\].
> 
> \[reaction\]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
> \[issues you find important\]: https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc

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.

---

<div class="post-metadata">

### Author: ![frozen.frog23](https://discourse.nixos.org/user_avatar/discourse.nixos.org/frozen.frog23/32/31895_2.png) [@frozen.frog23](https://discourse.nixos.org/u/frozen.frog23)
#### Post date: [May 10, 2025, 7:39pm UTC](https://discourse.nixos.org/t/firefox-apz-preferences-dont-work/64006/4 "2025-05-10T19:39:01Z")

</div>

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

…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 ☹

---

<div class="post-metadata">

### Author: ![aloop](https://discourse.nixos.org/user_avatar/discourse.nixos.org/aloop/32/12485_2.png) [@aloop](https://discourse.nixos.org/u/aloop)
#### Post date: [May 11, 2025, 7:58pm UTC](https://discourse.nixos.org/t/firefox-apz-preferences-dont-work/64006/5 "2025-05-11T19:58:19Z")

</div>

`programs.firefox.preferences` (which in the nixos module [sets values in](https://github.com/NixOS/nixpkgs/blob/dda3dcd3fe03e991015e9a74b22d35950f264a54/nixos/modules/programs/firefox.nix#L341-L345) `programs.firefox.policies.Preferences`) only supports certain values (listed at [policy-templates | Policy Templates for Firefox](https://mozilla.github.io/policy-templates/#preferences)).

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`.

---

<div class="post-metadata">

### Author: ![frozen.frog23](https://discourse.nixos.org/user_avatar/discourse.nixos.org/frozen.frog23/32/31895_2.png) [@frozen.frog23](https://discourse.nixos.org/u/frozen.frog23)
#### Post date: [May 11, 2025, 10:57pm UTC](https://discourse.nixos.org/t/firefox-apz-preferences-dont-work/64006/6 "2025-05-11T22:57:02Z")

</div>

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… 😭

i feel like a disorientated frog without my declarative browser settings… welp, still waiting for a fix! 😃 👍

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 🙂

---

<div class="post-metadata">

### Author: ![frozen.frog23](https://discourse.nixos.org/user_avatar/discourse.nixos.org/frozen.frog23/32/31895_2.png) [@frozen.frog23](https://discourse.nixos.org/u/frozen.frog23)
#### Post date: [May 12, 2025, 10:40pm UTC](https://discourse.nixos.org/t/firefox-apz-preferences-dont-work/64006/7 "2025-05-12T22:40:37Z")

</div>

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
