mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-03 20:19:19 +00:00
Install Thunderbird language packs through enterprise policies so Home Manager can use Mozilla's release-hosted XPIs without vendoring or hashing them. This also exposes programs.thunderbird.policies for configuring supported Thunderbird enterprise policies directly and wraps the configured Thunderbird package with merged extraPolicies.
53 lines
1.5 KiB
Nix
53 lines
1.5 KiB
Nix
# Confirm that both Firefox and Thunderbird can be configured at the same time.
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
|
nativeHostsDir =
|
|
if isDarwin then "Library/Mozilla/NativeMessagingHosts" else ".mozilla/native-messaging-hosts";
|
|
thunderbirdPackage = config.lib.test.mkStubPackage {
|
|
name = "thunderbird";
|
|
extraAttrs = {
|
|
override =
|
|
f:
|
|
let
|
|
overrides = f { extraPolicies = { }; };
|
|
in
|
|
(config.lib.test.mkStubPackage {
|
|
name = "thunderbird-with-native-host";
|
|
buildScript = ''
|
|
mkdir -p "$out/lib/mozilla/native-messaging-hosts"
|
|
echo wrapped > "$out/lib/mozilla/native-messaging-hosts/com.example.thunderbird-wrapped.json"
|
|
'';
|
|
})
|
|
// {
|
|
inherit (overrides) extraPolicies;
|
|
};
|
|
};
|
|
};
|
|
in
|
|
lib.recursiveUpdate (import ./thunderbird.nix { inherit config lib pkgs; }) {
|
|
programs.thunderbird = {
|
|
package = thunderbirdPackage;
|
|
nativeMessagingHosts = [
|
|
(config.lib.test.mkStubPackage {
|
|
name = "browserpass";
|
|
buildScript = ''
|
|
mkdir -p $out/lib/mozilla/native-messaging-hosts
|
|
echo test > $out/lib/mozilla/native-messaging-hosts/com.github.browserpass.native.json
|
|
'';
|
|
})
|
|
];
|
|
policies.DisableTelemetry = true;
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/${nativeHostsDir}/com.github.browserpass.native.json
|
|
assertFileExists home-files/${nativeHostsDir}/com.example.thunderbird-wrapped.json
|
|
'';
|
|
}
|