mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-14 21:11:08 +01:00
tests/thunderbird: dont use realPkgs
Not relevant for testing.
This commit is contained in:
parent
fc09cb7aaa
commit
412eb166eb
3 changed files with 43 additions and 29 deletions
|
|
@ -1,24 +1,29 @@
|
|||
# Confirm that both Firefox and Thunderbird can be configured at the same time.
|
||||
{ lib, realPkgs, ... }:
|
||||
lib.recursiveUpdate (import ./thunderbird.nix { inherit lib realPkgs; }) {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
||||
nativeHostsDir =
|
||||
if isDarwin then "Library/Mozilla/NativeMessagingHosts" else ".mozilla/native-messaging-hosts";
|
||||
in
|
||||
lib.recursiveUpdate (import ./thunderbird.nix { inherit config lib pkgs; }) {
|
||||
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
|
||||
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
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
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
|
||||
'';
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/${nativeHostsDir}/com.github.browserpass.native.json
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
# Confirm that both Firefox and Thunderbird can be configured at the same time.
|
||||
{ lib, realPkgs, ... }:
|
||||
lib.recursiveUpdate (import ./thunderbird.nix { inherit lib realPkgs; }) {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
lib.recursiveUpdate (import ./thunderbird.nix { inherit config lib pkgs; }) {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
# Darwin doesn't support wrapped Firefox, using unwrapped instead
|
||||
package = realPkgs.firefox-unwrapped;
|
||||
package = null;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
{ lib, realPkgs, ... }:
|
||||
{
|
||||
imports = [ ../../accounts/email-test-accounts.nix ];
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../../accounts/email-test-accounts.nix
|
||||
];
|
||||
|
||||
accounts.email.accounts = {
|
||||
"hm@example.com" = {
|
||||
|
|
@ -54,14 +60,13 @@
|
|||
|
||||
programs.thunderbird = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage {
|
||||
name = "thunderbird";
|
||||
};
|
||||
|
||||
# Disable warning so that platforms' behavior is the same
|
||||
darwinSetupWarning = false;
|
||||
|
||||
# Darwin doesn't support wrapped Thunderbird, using unwrapped instead;
|
||||
# using -latest- because ESR is currently broken on Darwin
|
||||
package = realPkgs.thunderbird-latest-unwrapped;
|
||||
|
||||
profiles = {
|
||||
first = {
|
||||
isDefault = true;
|
||||
|
|
@ -105,7 +110,7 @@
|
|||
|
||||
nmt.script =
|
||||
let
|
||||
isDarwin = realPkgs.stdenv.hostPlatform.isDarwin;
|
||||
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
||||
configDir = if isDarwin then "Library/Thunderbird" else ".thunderbird";
|
||||
profilesDir = if isDarwin then "${configDir}/Profiles" else "${configDir}";
|
||||
platform = if isDarwin then "darwin" else "linux";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue