Skip to content

[Feature Request] Firefox extensions with stricter permission checks #7890

@musjj

Description

@musjj

Module Name

firefox

Requested Feature

As a follow up to #7001, it would be nice if there is an option that can force the user to specify permissions for all extensions.

Current Limitations

Currently, a user can accidentally leave an extension's permissions unchecked, even if they didn't intend to:

{ pkgs, ... }:
{
  programs.firefox.profiles.default.extensions = {
    packages = with pkgs.nur.repos.rycee.firefox-addons; [
      foo
      bar
    ];
    settings = {
      # foo
      "{fda30378-ad30-4cce-a214-8c6bc61dfbea}" = {
        permissions = [ "storage" ];
      };
      # whoops! we forgot to check the permissions for bar!
    };
  };
}

home-manager will build this without any complaints (which is what most users probably want).

But for more cautious users, we can provide an new option that enforces stricter permission checks:

{
  programs.firefox.profiles.default.extensions.strictPermissions = true;
}

The build will now fail because we didn't specify the allowed permissions for bar.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions