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:
@@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
11
package.nix
11
package.nix
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user