mirror of
https://github.com/nix-community/home-manager
synced 2025-01-30 21:05:02 +01:00
parent
79eff1f6b9
commit
6fbbfb9240
2 changed files with 3 additions and 68 deletions
|
@ -136,24 +136,6 @@ let
|
||||||
'') prefs)}
|
'') prefs)}
|
||||||
${extraPrefs}
|
${extraPrefs}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeMessagingHostsPath = if isDarwin then
|
|
||||||
"${cfg.vendorPath}/NativeMessagingHosts"
|
|
||||||
else
|
|
||||||
"${cfg.vendorPath}/native-messaging-hosts";
|
|
||||||
|
|
||||||
nativeMessagingHostsJoined = pkgs.symlinkJoin {
|
|
||||||
name = "th_native-messaging-hosts";
|
|
||||||
paths = [
|
|
||||||
# Link a .keep file to keep the directory around
|
|
||||||
(pkgs.writeTextDir "lib/mozilla/native-messaging-hosts/.keep" "")
|
|
||||||
# Link package configured native messaging hosts (entire mail app actually)
|
|
||||||
cfg.package
|
|
||||||
]
|
|
||||||
# Link user configured native messaging hosts
|
|
||||||
++ cfg.nativeMessagingHosts;
|
|
||||||
};
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = with hm.maintainers; [ d-dervishi jkarlson ];
|
meta.maintainers = with hm.maintainers; [ d-dervishi jkarlson ];
|
||||||
|
|
||||||
|
@ -176,29 +158,6 @@ in {
|
||||||
description = "profile version, set null for nix-darwin";
|
description = "profile version, set null for nix-darwin";
|
||||||
};
|
};
|
||||||
|
|
||||||
vendorPath = mkOption {
|
|
||||||
internal = true;
|
|
||||||
type = with types; nullOr str;
|
|
||||||
# Thunderbird doesn't look in `Application Support` on macOS for user
|
|
||||||
# config (in contrast to global settings that are the same for Firefox
|
|
||||||
# and Thunderbird):
|
|
||||||
# https://developer.thunderbird.net/add-ons/mailextensions/supported-webextension-api
|
|
||||||
default = if isDarwin then "Library/Mozilla" else ".mozilla";
|
|
||||||
example = ".mozilla";
|
|
||||||
description =
|
|
||||||
"Directory containing the native messaging hosts directory.";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeMessagingHosts = optionalAttrs (cfg.vendorPath != null) (mkOption {
|
|
||||||
visible = true;
|
|
||||||
type = types.listOf types.package;
|
|
||||||
default = [ ];
|
|
||||||
description = ''
|
|
||||||
Additional packages containing native messaging hosts that should be
|
|
||||||
made available to Thunderbird extensions.
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
|
|
||||||
profiles = mkOption {
|
profiles = mkOption {
|
||||||
type = with types;
|
type = with types;
|
||||||
attrsOf (submodule ({ config, name, ... }: {
|
attrsOf (submodule ({ config, name, ... }: {
|
||||||
|
@ -444,13 +403,7 @@ in {
|
||||||
home.file = mkMerge ([{
|
home.file = mkMerge ([{
|
||||||
"${thunderbirdConfigPath}/profiles.ini" =
|
"${thunderbirdConfigPath}/profiles.ini" =
|
||||||
mkIf (cfg.profiles != { }) { text = generators.toINI { } profilesIni; };
|
mkIf (cfg.profiles != { }) { text = generators.toINI { } profilesIni; };
|
||||||
}] ++ optional (cfg.vendorPath != null) {
|
}] ++ flip mapAttrsToList cfg.profiles (name: profile: {
|
||||||
"${nativeMessagingHostsPath}" = {
|
|
||||||
source =
|
|
||||||
"${nativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts";
|
|
||||||
recursive = true;
|
|
||||||
};
|
|
||||||
} ++ flip mapAttrsToList cfg.profiles (name: profile: {
|
|
||||||
"${thunderbirdProfilesPath}/${name}/chrome/userChrome.css" =
|
"${thunderbirdProfilesPath}/${name}/chrome/userChrome.css" =
|
||||||
mkIf (profile.userChrome != "") { text = profile.userChrome; };
|
mkIf (profile.userChrome != "") { text = profile.userChrome; };
|
||||||
|
|
||||||
|
|
|
@ -41,9 +41,6 @@
|
||||||
# Disable warning so that platforms' behavior is the same
|
# Disable warning so that platforms' behavior is the same
|
||||||
darwinSetupWarning = false;
|
darwinSetupWarning = false;
|
||||||
|
|
||||||
# Darwin doesn't support wrapped Thunderbird, using unwrapped instead
|
|
||||||
package = pkgs.thunderbird-unwrapped;
|
|
||||||
|
|
||||||
profiles = {
|
profiles = {
|
||||||
first = {
|
first = {
|
||||||
isDefault = true;
|
isDefault = true;
|
||||||
|
@ -65,31 +62,18 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeMessagingHosts = with pkgs;
|
|
||||||
[
|
|
||||||
# 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. Good news is that the test will still pass as
|
|
||||||
# long as we don't attempt to run the mail client itself with the host.
|
|
||||||
# (Which we don't.)
|
|
||||||
browserpass
|
|
||||||
];
|
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
"general.useragent.override" = "";
|
"general.useragent.override" = "";
|
||||||
"privacy.donottrackheader.enabled" = true;
|
"privacy.donottrackheader.enabled" = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
test.stubs.thunderbird = { };
|
||||||
|
|
||||||
nmt.script = let
|
nmt.script = let
|
||||||
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
||||||
configDir = if isDarwin then "Library/Thunderbird" else ".thunderbird";
|
configDir = if isDarwin then "Library/Thunderbird" else ".thunderbird";
|
||||||
profilesDir = if isDarwin then "${configDir}/Profiles" else "${configDir}";
|
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";
|
platform = if isDarwin then "darwin" else "linux";
|
||||||
in ''
|
in ''
|
||||||
assertFileExists home-files/${configDir}/profiles.ini
|
assertFileExists home-files/${configDir}/profiles.ini
|
||||||
|
@ -111,7 +95,5 @@
|
||||||
assertFileExists home-files/${profilesDir}/first/chrome/userContent.css
|
assertFileExists home-files/${profilesDir}/first/chrome/userContent.css
|
||||||
assertFileContent home-files/${profilesDir}/first/chrome/userContent.css \
|
assertFileContent home-files/${profilesDir}/first/chrome/userContent.css \
|
||||||
<(echo "* { color: red !important; }")
|
<(echo "* { color: red !important; }")
|
||||||
|
|
||||||
assertFileExists home-files/${nativeHostsDir}/com.github.browserpass.native.json
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue