diff --git a/tests/modules/programs/thunderbird/default.nix b/tests/modules/programs/thunderbird/default.nix index a17755e1..0fddeec1 100644 --- a/tests/modules/programs/thunderbird/default.nix +++ b/tests/modules/programs/thunderbird/default.nix @@ -1,4 +1,5 @@ { thunderbird = ./thunderbird.nix; thunderbird-with-firefox = ./thunderbird-with-firefox.nix; + thunderbird-native-messaging-host = ./thunderbird-native-messaging-host.nix; } diff --git a/tests/modules/programs/thunderbird/thunderbird-native-messaging-host.nix b/tests/modules/programs/thunderbird/thunderbird-native-messaging-host.nix new file mode 100644 index 00000000..57bef0f1 --- /dev/null +++ b/tests/modules/programs/thunderbird/thunderbird-native-messaging-host.nix @@ -0,0 +1,25 @@ +# Confirm that both Firefox and Thunderbird can be configured at the same time. +{ lib, realPkgs, ... }: +lib.recursiveUpdate (import ./thunderbird.nix { inherit lib realPkgs; }) { + programs.thunderbird = { + nativeMessagingHosts = with realPkgs; + [ + # NOTE: this is not a real Thunderbird native host module but Firefox; no + # native hosts are currently packaged for nixpkgs or elsewhere, so we + # have to improvise. Packaging wise, Firefox and Thunderbird native hosts + # are identical though. The test doesn't care if the host was meant for + # either as long as the right paths are present in the package. + browserpass + ]; + }; + + nmt.script = let + isDarwin = realPkgs.stdenv.hostPlatform.isDarwin; + nativeHostsDir = if isDarwin then + "Library/Mozilla/NativeMessagingHosts" + else + ".mozilla/native-messaging-hosts"; + in '' + assertFileExists home-files/${nativeHostsDir}/com.github.browserpass.native.json + ''; +} diff --git a/tests/modules/programs/thunderbird/thunderbird.nix b/tests/modules/programs/thunderbird/thunderbird.nix index a5bb3148..75e83e67 100644 --- a/tests/modules/programs/thunderbird/thunderbird.nix +++ b/tests/modules/programs/thunderbird/thunderbird.nix @@ -66,16 +66,6 @@ }; }; - nativeMessagingHosts = with realPkgs; - [ - # NOTE: this is not a real Thunderbird native host module but Firefox; no - # native hosts are currently packaged for nixpkgs or elsewhere, so we - # have to improvise. Packaging wise, Firefox and Thunderbird native hosts - # are identical though. The test doesn't care if the host was meant for - # either as long as the right paths are present in the package. - browserpass - ]; - settings = { "general.useragent.override" = ""; "privacy.donottrackheader.enabled" = true; @@ -86,10 +76,6 @@ isDarwin = realPkgs.stdenv.hostPlatform.isDarwin; configDir = if isDarwin then "Library/Thunderbird" else ".thunderbird"; profilesDir = if isDarwin then "${configDir}/Profiles" else "${configDir}"; - nativeHostsDir = if isDarwin then - "Library/Mozilla/NativeMessagingHosts" - else - ".mozilla/native-messaging-hosts"; platform = if isDarwin then "darwin" else "linux"; in '' assertFileExists home-files/${configDir}/profiles.ini @@ -111,7 +97,5 @@ assertFileExists home-files/${profilesDir}/first/chrome/userContent.css assertFileContent home-files/${profilesDir}/first/chrome/userContent.css \ <(echo "* { color: red !important; }") - - assertFileExists home-files/${nativeHostsDir}/com.github.browserpass.native.json ''; }