firefox: add support for specifying policies (#4626)
This commit is contained in:
parent
c1a033122d
commit
3feeb77155
3 changed files with 42 additions and 1 deletions
|
|
@ -4,4 +4,5 @@
|
|||
firefox-deprecated-native-messenger = ./deprecated-native-messenger.nix;
|
||||
firefox-duplicate-profile-ids = ./duplicate-profile-ids.nix;
|
||||
firefox-duplicate-container-ids = ./duplicate-container-ids.nix;
|
||||
firefox-policies = ./policies.nix;
|
||||
}
|
||||
|
|
|
|||
26
tests/modules/programs/firefox/policies.nix
Normal file
26
tests/modules/programs/firefox/policies.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ 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; };
|
||||
};
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue