* 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>
57 lines
1.4 KiB
Nix
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;
|
|
};
|
|
};
|
|
};
|
|
}
|