Skip to content

Commit 568abe8

Browse files
authored
feat(hm-module): add new option to pass unwrapped package (#257)
1 parent 16e6705 commit 568abe8

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

hm-module/package.nix

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,30 @@ in {
4949
'';
5050
};
5151
};
52+
53+
unwrappedPackage = mkOption {
54+
type = types.nullOr types.package;
55+
default = null;
56+
description = ''
57+
An unwrapped Firefox-based browser derivation to use as the base instead of
58+
the flake's built-in variants (beta, twilight, etc.). When set, this package
59+
is wrapped with the same settings (policies, extraPrefs, etc.) and used as
60+
the program. Useful to use a different Zen build, another Firefox-based
61+
browser, or a custom unwrapped derivation.
62+
'';
63+
};
5264
};
5365

5466
config = mkIf cfg.enable {
5567
programs.zen-browser = {
5668
package = let
57-
defaultPackage = self.packages.${pkgs.stdenv.hostPlatform.system}."${name}-unwrapped".override {
58-
policies = cfg.policies;
59-
};
69+
defaultPackage =
70+
if cfg.unwrappedPackage != null
71+
then cfg.unwrappedPackage
72+
else
73+
self.packages.${pkgs.stdenv.hostPlatform.system}."${name}-unwrapped".override {
74+
policies = cfg.policies;
75+
};
6076

6177
getPackage = sine:
6278
if sine

0 commit comments

Comments
 (0)