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
isabel dd212be919 refactor: package & config cleanup (#88)
* refactor(package): use package fetchers

builtin fetchers are blocking, therefore also slow. for packaging we
should use the package fetchers

* refactor: build the desktop file as a part of the package

* refactor(default.nix): remove redundant args

* refactor(flake.nix): remove duplicated code & rec

* fix(hm-module)!: typo in mkFireFoxmodule

* fix(hm-module): work with nixpkgs config `allowAliases = false;`

* fix: partial revert of 805c8f56e8

the `lib.mkDefault` was being ignored and the policies would never be
set. perhaps a better thing to do here would be to remove them
completly. otherwise this is the next best thing

* refactor(package): use `hash` over `sha256`

Co-authored-by: Seth Flynn <getchoo@tuta.io>
2025-08-17 13:53:45 -05:00

57 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}";
unwrappedPackageName = "zen-${name}-unwrapped";
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.hostPlatform.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;
};
policies = {
DisableAppUpdate = lib.mkDefault true;
DisableTelemetry = lib.mkDefault true;
};
};
};
}