8 cfg = config.programs.thunderbird;
9 policyFormat = pkgs.formats.json { };
10 policyDoc = "https://github.com/thunderbird/policy-templates";
13 options.programs.thunderbird = {
14 enable = lib.mkEnableOption "Thunderbird mail client";
16 package = lib.mkPackageOption pkgs "thunderbird" { };
18 policies = lib.mkOption {
19 type = policyFormat.type;
22 Group policies to install.
24 See [Thunderbird's documentation](${policyDoc})
25 for a list of available options.
27 This can be used to install extensions declaratively! Check out the
28 documentation of the `ExtensionSettings` policy for details.
33 preferences = lib.mkOption {
43 Preferences to set from `about:config`.
45 Some of these might be able to be configured more ergonomically
50 preferencesStatus = lib.mkOption {
51 type = lib.types.enum [
59 The status of `thunderbird.preferences`.
61 `status` can assume the following values:
62 - `"default"`: Preferences appear as default.
63 - `"locked"`: Preferences appear as default and can't be changed.
64 - `"user"`: Preferences appear as changed.
65 - `"clear"`: Value has no effect. Resets to factory defaults on each startup.
70 config = lib.mkIf cfg.enable {
71 environment.systemPackages = [ cfg.package ];
75 policiesJSON = policyFormat.generate "thunderbird-policies.json" { inherit (cfg) policies; };
77 lib.mkIf (cfg.policies != { }) { "thunderbird/policies/policies.json".source = policiesJSON; };
79 programs.thunderbird.policies = {
80 DisableAppUpdate = true;
81 Preferences = builtins.mapAttrs (_: value: {
83 Status = cfg.preferencesStatus;
88 meta.maintainers = with lib.maintainers; [ nydragon ];