1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
Commit graph

59 commits

Author SHA1 Message Date
Austin Horstman
5200f3903f mkFirefoxModule: support extensions without addonID
Properly handle extensions missing addonId without eval error.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-10-10 08:40:00 -05:00
musjj
c7f4214fac firefox: new permission checks for extensions
Add two new options to customize how extension permissions are checked:

- `extensions.exhaustivePermissions`
  Ensures that the permissions requested by all extensions managed by
  home-manager are authorized
- `extensions.exactPermissions`
  When enabled, the user must authorize only the permissions that the
  extensions requests, not more nor less.
2025-10-09 21:06:28 -05:00
Ivy Pierlot
fccb44df77 mkFirefoxModule: make policies work on darwin 2025-08-31 18:39:22 -05:00
Austin Horstman
2b73c2fcca
treewide: remove config dependency on docs (#7547)
Tested with rebased
https://github.com/nix-community/home-manager/pull/6411 so I could find
all instances of config usage in docs.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
Co-authored-by: Robert Helgesson <robert@rycee.net>
2025-07-26 17:11:53 -05:00
Austin Horstman
b4752b0eda treewide: format with latest stable formatter
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-07-23 10:27:52 -05:00
bricked
d52da303ef
firefox: add extension permissions (#7402)
Adds extension permissions as suggested in
https://github.com/nix-community/home-manager/issues/7001.
Adds the 'profiles.<name>.extensions.settings.<name>.permissions' to Firefox
derivatives. If set, this option adds an assertion that fails if an extension
package requests permissions that weren't added to the permissions option. In
order to not require 'profiles.<name>.extensions.force' to be set when only
permissions, but no extension settings were defined, the relevant assertions
were changed. They now check whether any 'extensions.settings.<name>.settings'
was set instead of checking whether 'extensions.settings' was set.

---------

Co-authored-by: Robert Helgesson <robert@rycee.net>
Co-authored-by: awwpotato <awwpotato@voidq.com>
2025-07-10 15:33:18 -05:00
Austin Horstman
dbac1fbcd6 mkFirefoxModule: set NoDefaultBookmarks when a profile has bookmarks are enabled
This resolves issue that someone might try and configure bookmarks and a
policy will prevent it from applying properly.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-07-06 12:50:40 -05:00
Austin Horstman
b4486ff44a
mkFirefoxModule: add extension settings example to policies (#7397)
Add an example of using extension settings to control installation and
accesibility of a extension in the policies option.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-07-06 10:40:29 -05:00
bricked
153e680c42
firefox: add release option (#6784)
Adds the `release` option to declare what upstream release version is
used to fetch rom `releases.mozilla.org`. Used to fetch
language packs. See
https://github.com/nix-community/home-manager/issues/6758#issuecomment-2781465236.
2025-07-06 09:35:49 -05:00
Austin Horstman
b8bb556ce5 maintainers: remove duplicate HM entries
We can remove duplicate entries and redirect to the nixpkgs entry.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-07-04 09:20:48 -05:00
Yiheng He
1b25908d1d firefox: fix user.js extensions.settings creation
Creates the user.js if profile.extensions.settings is set.
This fixes the case when profile.extensions.settings is set but every
other option in the mkIf is false, resulting in no user.js creation.
2025-07-02 15:59:50 -05:00
Austin Horstman
4fca600cb1 treewide: implement auto importing for modules
Reduce maintenance burden and increase efficiency by automatically
importing modules following a specific convention.

Co-authored-by: awwpotato <awwpotato@voidq.com>
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-22 23:58:37 -05:00
xaltsc
0edffd088e
firefox: allow separators in bookmarks (#7284)
Allow users to create separators in their Firefox bookmarks.

Co-authored-by: xaltsc <hey@xaltsc.dev>
2025-06-16 15:51:11 -05:00
nakoo
4e9efaa68b
misc: add librewolf native messaging hosts (#7127) 2025-05-29 21:07:27 -05:00
Ihar Hrachyshka
75268f6252
tests: enable all firefox tests on darwin (plus derivations) (#6960) 2025-05-03 10:51:18 -05:00
Austin Horstman
9c46dc881c
mkFirefoxModule: support wrapped darwin derivations (#6913)
Wrapped firefox support was added for Darwin. We can now pass the extra parameters to wrap firefox on Darwin.
2025-04-27 20:15:17 -05:00
Austin Horstman
c42f04c83f
mkFirefoxModule: revert userChrome changes (#6887)
Reverting all the recent userChrome changes because of too many issues
and bikeshedding.
2025-04-22 20:44:48 -05:00
Austin Horstman
991a480472
mkFirefoxModule: userchrome support derivations (#6844) 2025-04-18 19:57:48 -05:00
Austin Horstman
c3c91dd8b4
mkFirefoxModule: fix userChrome with leading comment (#6836)
userChrome lines that started with a leading comment would cause an eval failure.
2025-04-17 09:31:27 -05:00
Austin Horstman
c6b75d69b6 tests/firefox: add userchrome test cases 2025-04-16 12:57:22 -07:00
Austin Horstman
1827e84344 mkFirefoxModule: fix userChrome 2025-04-16 12:57:22 -07:00
Jacob Birkett
7ede02c32a
progs: firefox: *.userChrome may be path or drv (#6761)
This allows `programs.firefox.profiles.*.userChrome` to be set to a:
derivation, path/path-like string to directory or file, or multiline
text to be used as content verbatim.

This allows setting, for example(s):
```nix
programs.firefox.profiles."jacob.default".userChrome = pkgs.wavefox;
programs.firefox.profiles."jacob.default".userChrome =
    "${pkgs.wavefox}/userChrome.css";
```
2025-04-16 11:28:18 -05:00
Austin Horstman
cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00
Austin Horstman
55cf1f1632
firefox: fix missing lib (#6744) 2025-04-01 08:25:30 -05:00
Austin Horstman
0b491b460f
treewide: remove with lib (#6735)
Continuation of `with lib;` cleanup.
2025-03-31 22:32:16 -05:00
Kira Bruneau
ad0614a1ec
firefox: don't show migration warning when bookmarks isn't set (#6689) 2025-03-23 18:13:55 -05:00
Kira Bruneau
0e75a40458
firefox: fix assertion when missing force for extensions (#6688) 2025-03-23 14:04:29 -05:00
bricked
ecbcd792e1 firefox: check if bookmarks attrset is of correct type 2025-03-23 14:04:01 -05:00
bricked
d7f451d7b1 firefox: replace with-lib-expression with inherit-expression 2025-03-23 14:04:01 -05:00
bricked
62d6a8931e firefox: fix bookmarks backwards compatibility
The legacy attrset option type for `firefox.profiles.<name>.bookmarks`
was accidentally removed in 9d55428. This adds back support for this
type by refactoring the bookmarks submodule. This also adds a new test
ensuring this won't happen again.
2025-03-23 14:04:01 -05:00
Kira Bruneau
8b629b5424 firefox: migrate search config to v12 2025-03-19 15:16:09 -05:00
Kira Bruneau
b44d79a5b2 firefox: migrate search config to v11 2025-03-19 15:16:09 -05:00
Kira Bruneau
c1dc900a1a firefox: migrate search config to v7 2025-03-19 15:16:09 -05:00
Kira Bruneau
9d554281e0
firefox: refactor bookmarks into a submodule & require force (#6402)
This splits the bookmarks submodule into a seperate file, to make it easier to maintain (like how the search module was previously split out in #5697).

This also refactors bookmarks to require a new force option, to be more explicit about overriding existing bookmarks.
2025-03-19 13:37:13 -05:00
Andrew Marshall
04c915bcf1
firefox: Support paths for userChrome & userContent (#3856)
A path may be preferred for some uses, and allowing it avoids the user
needing to `builtins.readFile`, thus creating duplicates and making it
more difficult to determine the actual store path.
2025-03-07 12:11:10 +01:00
HPsaucii
70fbbf05a5
Firefox: Apply global extension force setting to declarative extensions (#6567)
Respect the parent force option for the extension settings storage.js
2025-03-03 20:44:45 -06:00
Zeremonienmeister Berber
4f05ef6a8a
firefox: fix wrong syntax grammar for search setting isAppProvided (#6556)
The or operator is left associative, and since there is another
argument after the first term, the interpreter tries to apply whatever
the or-expression evaluates to.  If the first operand is unset, it
evaluates to removeAttrs, and everything is fine, but if it is set to
a boolean (which is what it should be set to), then it tries to apply
a boolean to arguments, and we get a type error.  Bracketing
explicitly with parentheses fixes this.

It presumably went unnoticed because not many people have tried
setting the option
`programs.firefox.profiles.<profile>.search.engines.<engine>.isAppProvided`.
2025-03-01 08:47:21 -06:00
Kilian Mio
87743e9383
firefox: deprecate vendorPath (#6519)
This is a reaction to PR #6460
2025-02-26 08:20:52 -06:00
Brieuc Dubois
61d8fc9af0
firefox: Allow to add PKCS11 modules (#5608) 2025-02-22 12:51:06 -06:00
Ihar Hrachyshka
1a78a4c7fe firefox: fix build failure when package is null
Native messaging hosts module assumed all hosts are packages, and we
were passing null before.

The patch also adds a test case for a null firefox package to avoid
regressions in the future for this common (on Darwin at least) scenario.

Note: Thunderbird doesn't need a similar change because it doesn't allow
a null package.

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-02-21 09:28:22 -08:00
Ihar Hrachyshka
7e81c581a5 thunderbird, firefox: fix file conflict for native messaging hosts
On Linux, both Thunderbird and Firefox use the same directory to contain
native messaging host modules. On this platform, we have to merge both
directories with native hosts into one.

The patch introduces a separate helper module to manage native host
directory generation. Now program modules (firefox, thunderbird) declare
native hosts to initialize; while the new helper module determines
*where* and *how* to merge them on disc.

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-02-21 09:28:22 -08:00
bricked
97ac0801d1
firefox: prevent extensions settings override (#6490)
Prevents extensions settings from accidentally being overriden when
using `profiles.<name>.extensions.settings`. Adds the
`profiles.<name>.extensions.force` option to acknowledge the risk.
2025-02-18 15:24:24 -06:00
HPsaucii
27ffa35178 firefox: add support for configuring extensions
This commit refactors programs.firefox.profiles.<name>.extensions in
order to support both installation of extensions (addons) and their
configuration. It does this by setting the
`extensions.webextensions.ExtensionStorageIDB.enabled` user_pref to
false.

When this preference is set to false, support for storing extension
settings in sqlite databases, also known as IndexedDB or IDB, is
reverted back to the JSON format present in firefox versions prior to
version 63, as seen here:
https://blog.mozilla.org/addons/2018/08/03/new-backend-for-storage-local-api/

IndexedDB was made the default due to performance improvements, but had
the consequence of removing any possibility of declarative extension
configuration without the assistance of firefox's policy system. The
policy system is supported by a small amount of extensions, such as
uBlock Origin, but has to be explicitly supported. Even when supported,
it provides significantly less granular control when compared to the
JSON storage format.
2025-02-17 12:17:38 -08:00
Kira Bruneau
30ea6fed4e
firefox: fix referencing name in profile-specific docs
Within the context of the profiles submodule, `${name}` refers to the
profile name, and not the Firefox fork name.

This fixes all descriptions to use the right name. This fixes a
previous commit that introduced a dependency between the documentation
and the user's configuration.
2025-02-05 22:10:32 +01:00
Kira Bruneau
f20b7a8ab5
firefox: fix referencing firefox fork name in profile-specific docs (#6407)
* firefox: fix referencing firefox fork name in profile-specific docs

Within the context of the profiles submodule, `${name}` refers to the
profile name, and not the firefox fork name.

This fixes all descriptions to use `${cfg.name}` instead.

* firefox: prefer cfg.name instead of name for consistency
2025-02-05 12:11:16 +01:00
Danil Suetin
0ee8bfdd04
firefox: add preConfig
Add `preConfig`, which acts like `extraConfig`, but placed before
`settings`. This will allow to overwrite settings in `preConfig`,
using `settings` option.
2025-01-29 18:36:43 +01:00
Andrew Marshall
bd530df4e2
firefox: avoid unnecessarily overriding package
When `cfg.package` is already wrapped, and wrapped without the
`ExtensionSettings` key set, this would always add that key, even if its
value was blank. This would result in `cfg.finalPackage` being a
functionally-identical, but differently-input-addressed package. This is
generally undesirable as it may result in multiple derivations being
built, and also if the value of `cfg.package` is expected to be
unchanged by the user (e.g. because they want it to be consistent
between NixOS and HM configuration).

Add a test to ensure this does not regress in the default case. Only
test on newish stateVersion since the logic for `isWrapped` differs on
older versions.
2025-01-29 18:29:44 +01:00
chayleaf
0bd5e9c76c
librewolf: hide bookmarks option 2024-11-18 22:14:54 +01:00
Kacper Koniuszy
aecd341dfe
firefox: improve search engine disclaimer generation
Using a fixed application name in the salt for the search engine name
hash can break with minor branding changes. For example, LibreWolf 127
used the application name "LibreWolf", but in version 128 it is
"Firefox".

The proper name can be found in about:support -> Application Basics.

Because it doesn't have to be related to the product name visible in
most of the browser (for example in the window title and help menus),
we shouldn't rely on cfg.name for that.

The application name can be read from lib/*/application.ini and we can
use that if the browser was installed via Home Manager. If not, we can
fall back to cfg.name.
2024-11-17 22:58:01 +01:00
Scharada
122f70545b
firefox: change container.json version to 5 2024-10-19 09:02:11 +02:00