feat: allow policies.json management via unwrapped package override (#49)

In previous iterations the browser were forced to have disabled updates but this
might create an undesirable behavior in tools like 1Password as you can see here:
https://github.com/0xc000022070/zen-browser-flake/issues/48

So I'm allowing to override the browser policies. This will only work for unwrapped packages.
This commit is contained in:
Luis Quiñones
2025-04-18 11:11:14 -05:00
committed by GitHub
parent e8429a2a3b
commit 805c8f56e8
2 changed files with 10 additions and 10 deletions

View File

@@ -3,8 +3,8 @@
self,
name,
}: {
pkgs,
config,
pkgs,
lib,
...
}: let
@@ -38,9 +38,10 @@ in {
config = lib.mkIf config.programs.zen-browser.enable {
programs.zen-browser = {
package = self.packages.${pkgs.stdenv.system}.${name};
policies = {
DisableAppUpdate = lib.mkDefault true;
DisableTelemetry = lib.mkDefault true;
# This does not work, the package can't build using these policies
policies = lib.mkDefault {
DisableAppUpdate = true;
DisableTelemetry = true;
};
};
};

View File

@@ -2,6 +2,7 @@
name,
variant,
desktopFile,
policies ? {},
lib,
stdenv,
config,
@@ -37,13 +38,11 @@
aarch64-linux = "linux-aarch64";
};
policies =
{
DisableAppUpdate = true;
}
// config.firefox.policies or {};
firefoxPolicies =
(config.firefox.policies or {})
// policies;
policiesJson = writeText "firefox-policies.json" (builtins.toJSON {inherit policies;});
policiesJson = writeText "firefox-policies.json" (builtins.toJSON {policies = firefoxPolicies;});
pname = "zen-${name}-bin-unwrapped";
in