mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 13:39:46 +01:00
bf4b576f84
This commit makes it possible to specify Firefox' extraPolicies
through:
programs.firefox.package = pkgs.firefox.override {
extraPolicies = {... }
}
This was possible in the past but was broken by:
3feeb77155
firefox: add support for specifying policies (#4626)
36 lines
1 KiB
Nix
36 lines
1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
imports = [ ./setup-firefox-mock-overlay.nix ];
|
|
|
|
config = lib.mkIf config.test.enableBig {
|
|
home.stateVersion = "23.05";
|
|
|
|
programs.firefox = {
|
|
enable = true;
|
|
policies = { BlockAboutConfig = true; };
|
|
package = pkgs.firefox.override {
|
|
extraPolicies = { DownloadDirectory = "/foo"; };
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
jq=${lib.getExe pkgs.jq}
|
|
config_file="${config.programs.firefox.finalPackage}/lib/firefox/distribution/policies.json"
|
|
|
|
assertFileExists "$config_file"
|
|
|
|
blockAboutConfig_actual_value="$($jq ".policies.BlockAboutConfig" $config_file)"
|
|
|
|
if [[ $blockAboutConfig_actual_value != "true" ]]; then
|
|
fail "Expected '$config_file' to set 'policies.BlockAboutConfig' to true"
|
|
fi
|
|
|
|
downloadDirectory_actual_value="$($jq ".policies.DownloadDirectory" $config_file)"
|
|
|
|
if [[ $downloadDirectory_actual_value != "\"/foo\"" ]]; then
|
|
fail "Expected '$config_file' to set 'policies.DownloadDirectory' to \"/foo\""
|
|
fi
|
|
'';
|
|
};
|
|
}
|