2.home-manager/tests/modules/programs/firefox/profiles/extensions/default.nix
2025-07-02 15:59:50 -05:00

44 lines
1.1 KiB
Nix

modulePath:
{ config, lib, ... }:
let
cfg = lib.getAttrFromPath modulePath config;
firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath;
in
{
imports = [ firefoxMockOverlay ];
config = lib.mkIf config.test.enableBig (
lib.setAttrByPath modulePath {
enable = true;
profiles.extensions = {
extensions = {
force = true;
settings = {
"uBlock0@raymondhill.net".settings = {
selectedFilterLists = [
"ublock-filters"
"ublock-badware"
"ublock-privacy"
"ublock-unbreak"
"ublock-quick-fixes"
];
};
};
};
};
}
// {
nmt.script = ''
assertFileContent \
"home-files/${cfg.profilesPath}/extensions/browser-extension-data/uBlock0@raymondhill.net/storage.js" \
${./expected-storage.js}
assertFileContent \
"home-files/${cfg.profilesPath}/extensions/user.js" \
${./expected-user.js}
'';
}
);
}