2024-03-13 00:20:41 +01:00
|
|
|
modulePath:
|
2023-11-17 23:54:39 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2024-03-13 00:20:41 +01:00
|
|
|
with lib;
|
2023-11-17 23:54:39 +01:00
|
|
|
|
2024-03-13 00:20:41 +01:00
|
|
|
let
|
2023-11-17 23:54:39 +01:00
|
|
|
|
2024-03-13 00:20:41 +01:00
|
|
|
cfg = getAttrFromPath modulePath config;
|
|
|
|
|
|
|
|
firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath;
|
2023-11-17 23:54:39 +01:00
|
|
|
|
2024-03-13 00:20:41 +01:00
|
|
|
in {
|
|
|
|
imports = [ firefoxMockOverlay ];
|
|
|
|
|
|
|
|
config = mkIf config.test.enableBig ({
|
|
|
|
home.stateVersion = "23.05";
|
|
|
|
} // setAttrByPath modulePath {
|
|
|
|
enable = true;
|
|
|
|
policies = { BlockAboutConfig = true; };
|
|
|
|
package = pkgs.${cfg.wrappedPackageName}.override {
|
|
|
|
extraPolicies = { DownloadDirectory = "/foo"; };
|
|
|
|
};
|
2024-10-12 00:21:33 +02:00
|
|
|
} // {
|
2023-11-17 23:54:39 +01:00
|
|
|
nmt.script = ''
|
|
|
|
jq=${lib.getExe pkgs.jq}
|
2024-03-13 00:20:41 +01:00
|
|
|
config_file="${cfg.finalPackage}/lib/${cfg.wrappedPackageName}/distribution/policies.json"
|
2023-11-17 23:54:39 +01:00
|
|
|
|
|
|
|
assertFileExists "$config_file"
|
2024-01-15 21:55:34 +01:00
|
|
|
|
2023-11-17 23:54:39 +01:00
|
|
|
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
|
2024-01-15 21:55:34 +01:00
|
|
|
|
|
|
|
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
|
2023-11-17 23:54:39 +01:00
|
|
|
'';
|
2024-10-12 00:21:33 +02:00
|
|
|
});
|
2023-11-17 23:54:39 +01:00
|
|
|
}
|