This repository has been archived on 2026-05-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
zen-browser-flake/hm-module.nix
Dmitry Chermnykh b5b7136bb6 Fix nativeMessagingHosts (#83)
* Fix nativeMessagingHosts

Something has changed in home-manager, so the nativeMessagingHosts option was broken

* re-format code
2025-08-09 16:34:36 +05:00

58 lines
1.4 KiB
Nix

{
home-manager,
self,
name,
}: {
config,
pkgs,
lib,
...
}: let
applicationName = "Zen Browser";
modulePath = [
"programs"
"zen-browser"
];
mkFirefoxModule = import "${home-manager.outPath}/modules/programs/firefox/mkFirefoxModule.nix";
in {
imports = [
(mkFirefoxModule {
inherit modulePath;
name = applicationName;
wrappedPackageName = "zen-${name}-unwrapped";
unwrappedPackageName = "zen-${name}";
visible = true;
platforms = {
linux = {
vendorPath = ".zen";
configPath = ".zen";
};
darwin = {
configPath = "Library/Application Support/Zen";
};
};
})
];
config = lib.mkIf config.programs.zen-browser.enable {
programs.zen-browser = {
package =
(pkgs.wrapFirefox (self.packages.${pkgs.stdenv.system}."${name}-unwrapped".override {
# Seems like zen uses relative (to the original binary) path to the policies.json file
# and ignores the overrides by pkgs.wrapFirefox
policies = config.programs.zen-browser.policies;
}) {}).override
{
nativeMessagingHosts = config.programs.zen-browser.nativeMessagingHosts;
};
# This does not work, the package can't build using these policies
policies = lib.mkDefault {
DisableAppUpdate = true;
DisableTelemetry = true;
};
};
};
}